Compare commits

...

638 Commits
v0.1.4 ... main

Author SHA1 Message Date
link
0d3b2f444e
Update README.md (#2323)
Some checks failed
Collect Code Coverage / build (push) Has been cancelled
Auto Publish Website / goreleaser (push) Has been cancelled
Signed-off-by: link <a624669980@163.com>
2025-08-06 16:54:02 +08:00
link
030bcd1095
Update README.md (#2322)
Signed-off-by: link <a624669980@163.com>
2025-08-06 16:09:10 +08:00
link
dad2f3f8c2
Update README.md (#2321)
Signed-off-by: link <a624669980@163.com>
2025-08-06 16:06:08 +08:00
link
b09160e76b
Update README.md (#2320)
Signed-off-by: link <a624669980@163.com>
2025-08-06 16:05:13 +08:00
link
12fc102753
Update README.md (#2319)
Signed-off-by: link <a624669980@163.com>
2025-08-06 15:51:40 +08:00
link
6ffe2cc89d
add twitter (#2318)
Signed-off-by: link <a624669980@163.com>
2025-08-06 15:48:06 +08:00
link
b9098101e2
Update system.go
Some checks failed
Collect Code Coverage / build (push) Has been cancelled
Auto Publish Website / goreleaser (push) Has been cancelled
Signed-off-by: link <a624669980@163.com>
2025-07-01 15:05:40 +08:00
U2FsdGVkX1
a6ff39e47d
Add initial RISC-V support (#2206)
Some checks failed
Collect Code Coverage / build (push) Has been cancelled
Auto Publish Website / goreleaser (push) Has been cancelled
It depends upon https://github.com/IceWhaleTech/github/pull/3

resolved https://github.com/IceWhaleTech/CasaOS/issues/1669
2025-04-16 14:16:50 +08:00
CorrectRoad
23eb739f01
Update README.md (#2185)
Some checks failed
Collect Code Coverage / build (push) Has been cancelled
Auto Publish Website / goreleaser (push) Has been cancelled
Signed-off-by: CorrectRoad <a778917369@gmail.com>
2025-03-08 12:38:58 +08:00
Ns2Kracy
ba285cb8bd
fix: update user info retrieval and clean up unused code (#2101)
Some checks failed
Collect Code Coverage / build (push) Has been cancelled
Auto Publish Website / goreleaser (push) Has been cancelled
2024-12-19 11:14:15 +08:00
Ns2Kracy
63f01489a8
update version (#2098)
Some checks failed
Collect Code Coverage / build (push) Has been cancelled
Auto Publish Website / goreleaser (push) Has been cancelled
2024-12-17 15:54:54 +08:00
Ns2Kracy
6bbb0802aa
fix: problem while getting storage type (#2097) 2024-12-17 15:53:04 +08:00
Ns2Kracy
c26cf4dbec
fix: cloud storage (#2096)
Some checks are pending
Collect Code Coverage / build (push) Waiting to run
Auto Publish Website / goreleaser (push) Waiting to run
2024-12-17 15:23:15 +08:00
Ns2Kracy
958a483385
Update constants.go (#2083)
Some checks failed
Collect Code Coverage / build (push) Has been cancelled
Auto Publish Website / goreleaser (push) Has been cancelled
2024-12-10 17:42:46 +08:00
Ns2Kracy
16e97ec66f
fix: too much log (#2078)
Some checks failed
Collect Code Coverage / build (push) Has been cancelled
Auto Publish Website / goreleaser (push) Has been cancelled
2024-12-06 15:43:54 +08:00
David Wood
5ea588b813
chore: fix problematic comments (#2030)
Some checks failed
Collect Code Coverage / build (push) Has been cancelled
Auto Publish Website / goreleaser (push) Has been cancelled
2024-12-04 11:04:17 +08:00
Lauren
7da0f0d49e
Update README.md
Signed-off-by: Lauren <Lauren-ED209@users.noreply.github.com>
2024-10-17 18:59:41 +08:00
Ns2Kracy
2adb795896
Update to 0.4.13 (#2004) 2024-09-18 15:53:41 +08:00
Ns2Kracy
8b251dc407
fix: get file content twice (#2000) 2024-09-14 23:21:03 +08:00
CorrectRoad
e4bf67dad5
chore: bump casaos version (#1999)
Signed-off-by: CorrectRoad <a778917369@gmail.com>
2024-09-14 11:37:28 +08:00
CorrectRoad
e8f9d3aaf5
fix: fix GitHub Action not work (#1996) 2024-09-11 16:04:30 +08:00
CorrectRoad
bb0d9ac25c
feat: add sync OpenAPI workflows (#1995) 2024-09-11 16:00:28 +08:00
link
3a835c00e3
Update constants.go (#1961)
Signed-off-by: link <a624669980@163.com>
2024-08-14 13:35:09 +08:00
link
e4447981cb
Update constants.go (#1950)
Signed-off-by: link <a624669980@163.com>
2024-08-12 14:19:40 +08:00
James Stroud
170b599e86
add instructions to update CasaOS (#1925)
This will help users to updates and determine the version of CasaOS from
a terminal session. I tested all commands multiple times. I hope you
like my suggestions. Take care
2024-07-31 14:26:24 +08:00
Ns2Kracy
18ce1d6342
fix: safe cmd (#1921) 2024-07-24 21:46:08 +08:00
Kian Kasad
1c483a5d9c
Fix typo in README.md: "tutoial" → "tutorial" (#1862)
Just fixing a typo I noticed while reading the README.

Signed-off-by: Kian Kasad <kian@kasad.com>
2024-07-23 10:34:45 +08:00
Ns2Kracy
8f7c99779f
feat: migrate gin to echo (#1854) 2024-06-04 14:14:55 +08:00
Link
0883f5f3aa update version 2024-05-15 09:27:01 +01:00
CorrectRoad
36dda53e9c
chore: bump version to 0.4.8 (#1750) 2024-03-26 11:28:20 +08:00
Link
53c3879907 update version 2024-03-05 06:43:33 +00:00
LinkLeong
ef57d3348d update version 2024-01-23 09:09:15 +00:00
link
7a76aca022
Update constants.go (#1615)
Signed-off-by: link <a624669980@163.com>
2024-01-18 15:45:35 +08:00
CorrectRoadH
fffdc7fd5e
fix: fix upload folder fail (#1614)
Signed-off-by: CorrectRoadH <a778917369@gmail.com>
2024-01-18 12:23:27 +08:00
CorrectRoadH
29d16d13ba
fix: fix upload specify file format is fail (#1613) 2024-01-18 11:39:49 +08:00
CorrectRoadH
54a115ae89
fix: fix upload folder is wrong (#1611) 2024-01-17 17:32:19 +08:00
John Guan
17fa7868a4
Update README.md (#1589)
add youtube link

Signed-off-by: John Guan <Guan.Ningchuan@gmail.com>
2024-01-05 15:05:16 +08:00
Eng Zer Jun
27d6dd86e2
Replace satori/go.uuid with google/uuid (#1573)
`github.com/satori/go.uuid` is no longer being actively maintained (last
commit was 5 years ago [^1]). So we should just use the newer
`github.com/google/uuid`.

[^1]: https://github.com/satori/go.uuid/commits/master/

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-12-28 16:40:17 +08:00
CorrectRoadH
ae50a9bb17
feat: add file upload implement to v2 api (#1566)
Signed-off-by: CorrectRoadH <a778917369@gmail.com>
2023-12-27 16:17:33 +08:00
Link
caf3347da9 update common 2023-12-26 09:51:43 +00:00
CorrectRoadH
718a08eab2
fix: fix codecov action run fail (#1567) 2023-12-21 15:14:36 +08:00
John Guan
6f722b3506
Update push_events_to_discord.yml (#1544)
remove alpha webhook

Signed-off-by: John Guan <Guan.Ningchuan@gmail.com>
2023-12-05 15:54:03 +08:00
Link
e722d841a9 update release 2023-11-28 08:08:59 +00:00
Link
3ccf58695b update go sum 2023-11-28 07:53:20 +00:00
Link
c52386cef4 update release 2023-11-28 07:48:38 +00:00
Link
acac2df40f update go.mod 2023-11-20 08:30:14 +00:00
Link
0b507cb7ad update action 2023-11-20 08:22:13 +00:00
Link
ac90509c66 update action 2023-11-20 08:20:03 +00:00
Link
abf7134710 update releaser 2023-11-20 08:13:41 +00:00
Link
f9a26af93f update goreleaser 2023-11-20 08:05:25 +00:00
John Guan
33eacbf4b3
Update demo.yml (#1513)
Update to CasaOS-v0.4.4-3-Demo-1700132299

Signed-off-by: John Guan <Guan.Ningchuan@gmail.com>
2023-11-16 19:05:48 +08:00
John Guan
262e0d49c8
Update demo.yml (#1512)
update CasaOS demo to v0.4.4.3-demo

Signed-off-by: John Guan <Guan.Ningchuan@gmail.com>
2023-11-16 18:14:22 +08:00
LinkLeong
689b0f769a update file 2023-11-10 03:24:24 +00:00
LinkLeong
8f8a082888 update zt 2023-11-09 06:04:45 +00:00
link
9b8c6f4299
Delete __debug_bin782867005
Signed-off-by: link <a624669980@163.com>
2023-10-24 18:57:41 +08:00
LinkLeong
657cbe5c41 delay delete temp file 2023-10-23 09:06:41 +01:00
Liviu
b17bff68dd
Added small description on th casosapi health and file sys (#1417)
🐙  Hi , 

hope the small description is oke ! :)
2023-09-27 18:35:17 +08:00
LinkLeong
7807cfdb01 updat version 2023-09-22 10:03:34 +01:00
LinkLeong
9e5381710f update file task 2023-09-12 09:16:18 +01:00
LinkLeong
fa62c65526 add amd cpu suport 2023-09-11 09:39:50 +01:00
LinkLeong
3aea945277 update readme 2023-09-11 04:22:08 +01:00
LinkLeong
4d8ca182cb Merge branch 'main' of github.com:IceWhaleTech/CasaOS 2023-09-04 04:30:59 +01:00
LinkLeong
b727606a0a update version 2023-09-04 04:30:53 +01:00
Ikko Eltociear Ashimine
428be5f2c2
Update casa.yml (#1375)
enviroment -> environment

Signed-off-by: Ikko Eltociear Ashimine <eltociear@gmail.com>
Co-authored-by: Tiger Wang <tigerwang@outlook.com>
2023-09-04 07:36:38 +08:00
aevum123
995d67543d
Update README.md (#1374)
Couple small grammar fixes

Signed-off-by: aevum123 <87996440+aevum123@users.noreply.github.com>
2023-09-04 07:35:20 +08:00
omahs
590beac43a
Fix minor typos (#1372)
Fix minor typos

Signed-off-by: omahs <73983677+omahs@users.noreply.github.com>
2023-09-03 20:56:48 +08:00
kerta1n
e7bf227232
Update README.md, Debian 12 stable (#1352)
Now that Debian 12 is stable, IWT's team should check to make sure that
CasaOS is stable and then update the wiki

Signed-off-by: kerta1n <36344851+kerta1n@users.noreply.github.com>
Co-authored-by: Tiger Wang <tigerwang@outlook.com>
2023-09-01 15:41:33 +08:00
LinkLeong
eedfdde311 add filter 2023-08-31 07:26:44 +01:00
LinkLeong
38c7b5a569 update name 2023-08-24 11:57:32 +01:00
LinkLeong
8c0b219621 update path 2023-08-24 11:21:44 +01:00
LinkLeong
23fc677f30 Merge branch 'main' of github.com:IceWhaleTech/CasaOS 2023-08-24 09:23:45 +01:00
LinkLeong
a06508783c update path 2023-08-24 09:23:40 +01:00
Tiger Wang
37fee157dd
add message-bus-codegen CLI tool for generating a markdown of all event types (#1346) 2023-08-23 18:21:12 +08:00
LinkLeong
3f1c7098bd add v3 file path 2023-08-23 08:29:41 +01:00
LinkLeong
b11d046c52 add route 2023-08-23 04:35:43 +01:00
LinkLeong
d6a9ba65ed add onedrive icon 2023-08-22 05:01:40 +01:00
link
5f1df76dbf
Community (#1341) 2023-08-18 15:46:29 +08:00
Tiger Wang
0cf353c56e
create default config if it does not already exist (#1304) 2023-07-31 16:53:03 +08:00
LinkLeong
5dc6297047 Merge branch 'main' of github.com:IceWhaleTech/CasaOS 2023-07-25 03:29:00 +01:00
LinkLeong
f26ae2793c Update zerotier 2023-07-25 03:28:52 +01:00
CorrectRoadH
d7641e1b93
chore: fix the readme error (#1270)
Signed-off-by: CorrectRoadH <a778917369@gmail.com>
2023-07-21 20:44:11 +08:00
CorrectRoadH
37c496fd6a
chore:add zhanghenxing to contributor (#1269)
same to the title
2023-07-21 20:43:07 +08:00
CorrectRoadH
cb15c06f7e
chore: add Contributor (#1268)
😆add me to the contributor list🤫
My Code in https://github.com/IceWhaleTech/CasaOS-AppManagement
My Document in https://github.com/IceWhaleTech/CasaOS-AppStore/pull/187
2023-07-21 20:38:04 +08:00
LinkLeong
89a0ea34b0 Add get version function 2023-07-20 04:12:46 +01:00
LinkLeong
d8dd815baa Update ip 2023-07-19 07:46:23 +01:00
LinkLeong
a77b5d1954 Update ip 2023-07-18 08:54:01 +01:00
LinkLeong
d0fb2f06f5 Supplementary log 2023-07-18 08:13:11 +01:00
raller1028
dd8032a8be
Update push_test_server.yml (#1243)
Signed-off-by: raller1028 <57336867+raller1028@users.noreply.github.com>
2023-07-12 15:06:55 +08:00
raller1028
760882e147
Update push_test_server.yml (#1233)
Signed-off-by: raller1028 <57336867+raller1028@users.noreply.github.com>
2023-07-03 17:10:45 +08:00
LinkLeong
dfeed76a66 Update permission issues 2023-07-03 10:08:05 +01:00
Tiger Wang
28d724731a
remove submit application template 2023-06-27 08:18:15 -04:00
Tiger Wang
4549d8778b
remove feedback template 2023-06-27 08:15:52 -04:00
Tiger Wang
05cadaabf3
update bug_report.md (#1216)
Signed-off-by: Tiger Wang <tigerwang@outlook.com>
2023-06-26 17:36:34 -04:00
link
1a0c15208c
Update demo.yml (#1213)
Signed-off-by: link <a624669980@163.com>
2023-06-25 17:09:31 +08:00
link
4f5b4b0887
Update demo.yml (#1212)
Signed-off-by: link <a624669980@163.com>
2023-06-25 17:07:17 +08:00
link
cbfe44be61
Update demo.yml (#1211)
Signed-off-by: link <a624669980@163.com>
2023-06-25 17:05:27 +08:00
link
e1bbb998df
Update demo.yml (#1210)
Signed-off-by: link <a624669980@163.com>
2023-06-25 16:58:29 +08:00
link
f48cddf924
Up json (#1186) 2023-06-14 11:32:04 +08:00
raller1028
23ce3487e1
Update demo.yml (#1174)
Add demo reset error handle

Signed-off-by: raller1028 <57336867+raller1028@users.noreply.github.com>
2023-06-07 16:09:01 +08:00
link
6246421dae
Up json (#1173)
Signed-off-by: link <a624669980@163.com>
2023-06-07 15:23:29 +08:00
link
f867453573
Update entry json output (#1172) 2023-06-07 15:21:22 +08:00
link
78e7a8b411
Add zt dynamic ip (#1168) 2023-06-05 16:49:32 +08:00
link
1aa8fb600b
Remove 9527 (#1162) 2023-06-02 18:51:25 +08:00
link
7ecfea71ab
Update json (#1160) 2023-06-01 17:09:34 +08:00
link
d911d80254
Socket update (#1159) 2023-06-01 10:22:04 +08:00
link
9bfe37305c
Socket update (#1154) 2023-05-31 18:02:46 +08:00
link
94dd2e00c7
Socket update (#1153) 2023-05-31 16:10:14 +08:00
link
c5d2cebe92
Socket update (#1151) 2023-05-30 18:57:15 +08:00
link
955e8dea07
Update socket address (#1147) 2023-05-29 17:17:39 +08:00
link
4c7b3a749b
Zt update (#1146) 2023-05-29 15:38:39 +08:00
link
e86a61596b
Update zt (#1139) 2023-05-26 18:37:16 +08:00
link
c9617e583f
Add zertier (#1137)
Signed-off-by: link <a624669980@163.com>
2023-05-26 17:45:18 +08:00
link
dda15b0821
Add zertier (#1124)
Signed-off-by: link <a624669980@163.com>
2023-05-25 12:14:32 +08:00
link
50816c68b0
Update demo.yml (#1121)
Signed-off-by: link <a624669980@163.com>
2023-05-24 19:12:18 +08:00
李旭海
c5de0319fb
Update publish_npm.yaml (#1120)
Signed-off-by: 李旭海 <lxh_shine@hotmail.com>
Signed-off-by: zhanghengxin <812718649@qq.com>
Co-authored-by: zhanghengxin <812718649@qq.com>
2023-05-24 13:49:03 +08:00
link
78b7c6ce09
Add zertier (#1116) 2023-05-23 16:39:25 +08:00
link
b420a2d930
Add logs function (#1108) 2023-05-22 17:28:30 +08:00
zhanghengxin
c67ee1731c
Introducing new features.Incorporating automatic publishin… (#1107)
Introducing new features.Incorporating automatic publishing for the
openAPI npm package.
2023-05-22 16:45:06 +08:00
raller1028
eaca399ef9
Add zerotier route (#1098) 2023-05-22 16:44:39 +08:00
LinkLeong
e0e9f97764 Update ip address 2023-05-22 04:32:47 +01:00
link
2fefee87fa
Fixed compression error (#1097) 2023-05-19 16:50:48 +08:00
link
280ad4fcf9
Add merge json (#1079) 2023-05-15 11:01:21 +08:00
Tiger Wang
538639b623
fix (*service).Ports() missing ports from IPv6 (#1069) 2023-05-09 17:02:59 -04:00
老竭力
39535d6a38
Update README.md (#1067)
Signed-off-by: 老竭力 <jerrykuku@qq.com>
2023-05-09 18:13:29 +08:00
老竭力
4d977d7a62
Update demo.yml (#1049)
Signed-off-by: 老竭力 <jerrykuku@qq.com>
2023-05-06 11:35:44 +08:00
link
08c500c434
Add local jwt (#1047) 2023-05-05 10:37:23 +08:00
link
705bf1facb
Update jwt (#1025) 2023-04-26 16:00:43 +08:00
Tiger Wang
aae1802191 bump version from 0.4.3 to 0.4.4
Signed-off-by: Tiger Wang <tigerwang@outlook.com>
2023-04-24 16:11:16 -04:00
Tiger Wang
8e1b9b82c1
add /v2/casaos/health/ports to get ports in use (#1023)
Signed-off-by: Tiger Wang <tigerwang@outlook.com>
2023-04-24 16:10:15 -04:00
link
af440eac55
Update samba (#1021) 2023-04-24 11:24:22 +08:00
link
34b4e154a1
fix reboot auto mount (#1007) 2023-04-12 13:53:27 +08:00
Lauren
79db93ec02
Update README.md
Update the project introduction

Signed-off-by: Lauren <Lauren-ED209@users.noreply.github.com>
2023-03-29 17:57:17 +08:00
Tiger Wang
f8ec3b20cd
upgrade dependencies (#978)
Signed-off-by: Tiger Wang <tigerwang@outlook.com>
2023-03-25 23:37:00 -04:00
LinkLeong
8c7c8dc1ec Adding asynchronous methods 2023-03-24 08:07:38 +00:00
link
60a141fe25
Test init log (#974) 2023-03-23 12:09:46 +08:00
link
02e712f649
Test init log (#972) 2023-03-22 16:06:48 +08:00
link
7022cf5d29
Add test log init (#971) 2023-03-22 14:07:01 +08:00
Tiger Wang
6cf46ce50c
update github workflow with newer version of different actions (#970) 2023-03-21 22:59:31 -04:00
link
202c1de570
Update file count (#969) 2023-03-21 14:25:01 +08:00
link
858ab5b124
Update file count (#968) 2023-03-21 10:12:03 +08:00
link
e319975a60
Update file count (#966) 2023-03-20 19:47:13 +08:00
link
5c2c3b5e98
Update file count (#965) 2023-03-20 17:02:42 +08:00
link
a0dc58264a
Update interface result state (#964) 2023-03-20 15:24:45 +08:00
Tiger Wang
717b47ca2c
clean up some unnecessary dependencies, logics, and linter warnings (#963)
Signed-off-by: Tiger Wang <tigerwang@outlook.com>
2023-03-18 20:55:51 -04:00
LinkLeong
f530f69ba5 Update migration.list 2023-03-17 08:10:01 +00:00
LinkLeong
87b190a84b Remove fs.go 2023-03-17 08:00:06 +00:00
link
10191a1be3
Test rclone (#961) 2023-03-17 15:37:28 +08:00
Tiger Wang
59f2ccbeb3
move app request to CasaOS-AppStore (#958)
Signed-off-by: Tiger Wang <tigerwang@outlook.com>
2023-03-15 21:02:34 -04:00
link
076b7198b2 Special treatment for arm equipment 2023-03-15 06:20:58 +00:00
link
eb483a4c5d
Change log (#955) 2023-03-15 10:46:12 +08:00
link
60e81bc781
Change changelog (#953) 2023-03-14 14:02:44 +08:00
link
dc8ee89c85
Statistics on the number of files added (#951) 2023-03-13 18:30:22 +08:00
link
c995750312
Socket service (#949) 2023-03-13 09:42:18 +08:00
Tiger Wang
de6ed093a2
Create SECURITY.md
Signed-off-by: Tiger Wang <tigerwang@outlook.com>
2023-03-08 20:07:56 -05:00
link
449e1515d9
Rclone update (#935) 2023-03-06 16:10:19 +08:00
raller1028
e6ddb0d849
Update push_test_server.yml
Signed-off-by: raller1028 <57336867+raller1028@users.noreply.github.com>
2023-03-02 15:46:34 +08:00
link
c19e32c6e9
Modify user rights (#922) 2023-02-24 14:35:38 +08:00
link
94755e221a
Add judgment on mount points (#921) 2023-02-24 14:20:30 +08:00
link
86a3692dad
Add proxy search interface (#917) 2023-02-23 10:38:48 +08:00
raller1028
45a5567978
Update push_test_server.yml
Signed-off-by: raller1028 <57336867+raller1028@users.noreply.github.com>
2023-02-21 15:45:43 +08:00
link
3190421fd9
Start sequence (#904)
Signed-off-by: link <a624669980@163.com>
2023-02-17 19:31:22 +08:00
link
a7126cac63
Rotational training registration to message-bus (#903) 2023-02-17 18:40:19 +08:00
raller1028
151aa037bb
Update push_test_server.yml
Signed-off-by: raller1028 <57336867+raller1028@users.noreply.github.com>
2023-02-17 11:46:30 +08:00
raller1028
08ed9933ee
Update push_test_server.yml
Signed-off-by: raller1028 <57336867+raller1028@users.noreply.github.com>
2023-02-16 18:32:47 +08:00
raller1028
8425011e73
Update push_test_server.yml
Signed-off-by: raller1028 <57336867+raller1028@users.noreply.github.com>
2023-02-16 18:20:40 +08:00
link
96ff550d61
Fix permission change cannot be unmount (#902) 2023-02-16 16:55:51 +08:00
link
85a803d352
Update service (#900) 2023-02-16 14:23:49 +08:00
link
5def3e5856
Add error log (#899) 2023-02-16 09:08:35 +08:00
Tiger Wang
c768260b1b
add CODE_OF_CONDUCT.md (#898)
Signed-off-by: Tiger Wang <tigerwang@outlook.com>
2023-02-15 16:14:47 -05:00
link
46e146e633
Fix the download file name error problem (#896) 2023-02-15 17:31:20 +08:00
link
1a2f917b30
Exception handling when adding a mount to the same device (#890) 2023-02-13 19:42:34 +08:00
link
86adfbaef8
Updated demo snapshot (#889) 2023-02-13 18:58:21 +08:00
link
143af78745
Add 0.4.2 changelog (#885) 2023-02-10 19:11:36 +08:00
link
7b07f22685
Fix sharing failure issue (#884) 2023-02-10 17:27:13 +08:00
Tiger Wang
c8b6a1c228
fix installation issue for Mint Linux (#881)
Signed-off-by: Tiger Wang <tigerwang@outlook.com>
2023-02-09 19:51:00 -05:00
link
827fba2164
Add error logs (#879) 2023-02-09 17:29:33 +08:00
link
6217009caf
The same driver and the same account can only be hooked up once (#878)
Signed-off-by: link <a624669980@163.com>
2023-02-09 17:23:33 +08:00
link
fbfcc2c43a
Remount if the configuration file already exists (#877) 2023-02-09 16:10:16 +08:00
link
b331c484f5
Add uninstall error judgment (#875) 2023-02-09 10:31:15 +08:00
link
a1fbbf9584
Modify the configuration file (#872) 2023-02-08 18:11:46 +08:00
link
3611ec7d09
Return directly if name does not exist (#871) 2023-02-07 21:58:01 +08:00
link
7dedbafc8a Modify naming rules 2023-02-07 10:32:12 +00:00
link
b7634402bd Merge branch 'main' of https://github.com/IceWhaleTech/CasaOS 2023-02-07 06:39:31 +00:00
link
8e025a9836 Mounted folders are inoperable 2023-02-07 06:38:21 +00:00
Tiger Wang
8bfc8178cf
remove obsolete functions for notification of app installation/uninstallation (#867)
Signed-off-by: Tiger Wang <tigerwang@outlook.com>
2023-02-06 21:53:09 -05:00
link
8343f52137
Return of error when modifying mount (#864) 2023-02-06 17:44:37 +08:00
link
7501833cf9
Modify file permissions (#860) 2023-02-06 17:43:40 +08:00
link
4c917a33a4
Remove client judgment (#862) 2023-02-06 17:10:05 +08:00
link
173997c44b
Send notification changes to message bus (#861) 2023-02-06 15:47:29 +08:00
link
76bc6e68ae Modify file list return data 2023-02-02 15:59:33 +00:00
link
d0fc2cc8cb Conflict resolution 2023-02-02 03:52:17 +00:00
link
32980f4033 Merge branch 'add_file_drive' 2023-02-02 03:51:41 +00:00
link
28d3ca0ca6 added google drive and dropbox driver 2023-02-02 03:36:59 +00:00
link
3d31ad6689
Create push_test_server.yml
Signed-off-by: link <a624669980@163.com>
2023-01-31 18:19:36 +08:00
Tiger Wang
0bb138e39e
add API for checking casaos-* service status (#852)
Signed-off-by: Tiger Wang <tigerwang@outlook.com>
2023-01-30 17:01:47 -05:00
link
e8db1767e5
Update CHANGELOG.md
Signed-off-by: link <a624669980@163.com>
2023-01-19 21:42:10 +08:00
link
6b01263252
Update CHANGELOG.md
Signed-off-by: link <a624669980@163.com>
2023-01-19 10:16:55 +08:00
Tiger Wang
b2a4fafdb4 add race detection for tests 2023-01-17 12:49:49 -05:00
Tiger Wang
fcfb48d88e
enable code coverage (#825) 2023-01-16 17:58:25 -05:00
link
86380d912d
Allow specific special characters (#823) 2023-01-16 14:10:39 +08:00
link
87d8be8c61 added google drive 2023-01-16 05:54:44 +00:00
link
9123974811
Update CHANGELOG.md
Signed-off-by: link <a624669980@163.com>
2023-01-09 18:08:47 +08:00
link
be50579544
add update type (#812) 2023-01-09 15:16:04 +08:00
link
91bb0cba6f
Update CHANGELOG.md
Signed-off-by: link <a624669980@163.com>
2023-01-08 15:33:48 +08:00
link
b9946db854
repair the error of version number display after successful update (#805) 2023-01-05 15:16:54 +08:00
老竭力
9eb650b444
Add download triage for download migration-tool (#793)
Co-authored-by: Tiger Wang <tigerwang@outlook.com>
2023-01-05 10:47:44 +08:00
Tiger Wang
84f17b4c4b
add upx as part of building step to shrink the size of binary files (#797) 2022-12-29 18:24:36 -05:00
Tiger Wang
8cff99f726 enable unit tests as part of release process (with 3 always failing tests skipped)
Signed-off-by: Tiger Wang <tigerwang@outlook.com>
2022-12-22 23:32:12 +00:00
Tiger Wang
ea166f890b remove deps under GPL and add license check to workflow
Signed-off-by: Tiger Wang <tigerwang@outlook.com>
2022-12-22 16:25:40 -05:00
LinkLeong
d350c3e96f remove socket-port function 2022-12-22 03:53:55 +00:00
LinkLeong
ec0d98627d Merge branch 'main' of https://github.com/IceWhaleTech/CasaOS 2022-12-22 03:50:55 +00:00
LinkLeong
fd3cb5b0f0 update common package 2022-12-22 03:50:52 +00:00
Tiger Wang
0155dc1877 bump version from 0.4.0 to 0.4.1
Signed-off-by: Tiger Wang <tigerwang@outlook.com>
2022-12-21 03:26:30 +00:00
link
cd79e51f8f
Socketio modification (#771) 2022-12-20 14:05:16 +08:00
Tiger Wang
c6d89f9cb2
update CasaOS-Common from v0.4.0 to v0.4.1-alpha1 for the new notify.Application struct (#768)
Signed-off-by: Tiger Wang <tigerwang@outlook.com>
2022-12-19 19:08:12 -05:00
Tiger Wang
4b26631374
add logic to run scripts under /etc/casaos/start.d when starting (#756) 2022-12-15 18:31:06 -05:00
John Guan
ba742b9fb2 Update README.md 2022-12-14 11:32:19 +08:00
LinkLeong
57e5a710e0 change changelog 2022-12-13 08:53:06 +00:00
link
062d95c1eb
done (#750) 2022-12-10 17:42:05 +08:00
link
75643287a5
finish (#742) 2022-12-07 14:29:22 +08:00
link
6bda9406fb
fixed (#741) 2022-12-07 10:57:27 +08:00
Tiger Wang
be9a010d17
fix sqlite db lock by reducing maximum open connections to 1 (#732) 2022-12-02 17:25:44 -05:00
Tiger Wang
3875827b7a
replace CGO implementation of sqlite with an implementation in pure Go (#724) 2022-11-30 00:10:05 -05:00
LinkLeong
5338d4662e Merge branch 'main' of https://github.com/IceWhaleTech/CasaOS 2022-11-30 04:11:36 +00:00
LinkLeong
3b9c4b62c5 Remove frequent logs 2022-11-30 04:10:46 +00:00
Tiger Wang
536eac788d
move app domain to its own module (0.4.x) (#689) 2022-11-29 12:17:14 -05:00
Ns2Kracy
fc371bf068
add arch support (#707) 2022-11-29 10:44:45 -05:00
LinkLeong
299b20a087 Merge branch 'main' of https://github.com/IceWhaleTech/CasaOS 2022-11-29 02:25:36 +00:00
LinkLeong
eb31bf5586 wip 2022-11-29 02:25:26 +00:00
mojothemonkey2
04d4eacc60
Re-instate default zone0 for CPU Temp (fix #694) (#708) 2022-11-25 14:28:51 +08:00
LinkLeong
60608c5dc7 update update.sh 2022-11-21 11:23:03 +00:00
link
b582e8f53e
Update CHANGELOG.md
Signed-off-by: link <a624669980@163.com>
2022-11-21 18:21:03 +08:00
mojothemonkey2
5690ccc1b5
CPU temp support for other platforms (fix #661) (#677)
Signed-off-by: link <a624669980@163.com>
Co-authored-by: link <a624669980@163.com>
2022-11-16 17:30:19 +08:00
LinkLeong
13c2967889 update changelog 2022-11-16 05:57:39 +00:00
a624669980@163.com
8a37f9c879 Merge branch 'heads/v0.3.7' 2022-11-15 15:56:08 +08:00
Tiger Wang
96e9284235
Update README.md
Signed-off-by: Tiger Wang <tigerwang@outlook.com>
2022-11-07 11:22:16 -05:00
Tiger Wang
06f83d3d68
Update bug_report.md
Signed-off-by: Tiger Wang <tigerwang@outlook.com>
2022-11-04 07:36:52 -04:00
LinkLeong
438b8a1dd2 Solve the problem of local application import failure 2022-11-04 07:41:09 +00:00
Tiger Wang
29e701cb7c
fix potential goroutine leak due to http request without a timeout (#656) 2022-11-03 18:07:49 -04:00
Tiger Wang
43cc7596d2
bump version (#650) 2022-11-02 11:07:30 -04:00
John Guan
11f800d138 Update feedback.yml 2022-11-02 11:31:14 +08:00
John Guan
a58a9e5477 update issue templates 2022-11-02 11:29:21 +08:00
John Guan
5f015e9038 update issue templates 2022-11-02 11:26:24 +08:00
John Guan
3922296d9b Revert "Update alpha_bug_report.yml"
This reverts commit 908a16ace4da1a7a32706d1b6b87c0d3674fa101.
2022-11-02 11:24:58 +08:00
John Guan
908a16ace4 Update alpha_bug_report.yml 2022-11-02 11:24:37 +08:00
John Guan
f7a3863720 Update .gitignore 2022-11-02 10:50:01 +08:00
link
e94c2ff5c5
Update release.yml
Signed-off-by: link <a624669980@163.com>
2022-10-31 14:40:32 +08:00
link
89487eb5db
Update CHANGELOG.md
Signed-off-by: link <a624669980@163.com>
2022-10-29 10:36:51 +08:00
Tiger Wang
0fb5cab480
move common proxy to CasaOS-Common (#643)
...and use gateway proxy from CasaOS-Common
2022-10-28 17:34:18 -04:00
link
f210f29ae5
Update CHANGELOG.md
Signed-off-by: link <a624669980@163.com>
2022-10-28 08:27:00 +08:00
Tiger Wang
7bd5c6a2b4 remove repeating logging to reduce unnecessary verbosity 2022-10-27 11:59:35 -04:00
link
230f1585a3
V0.3.7 (#629)
* add send notify function

* add shell script

* add system notiry

* remove disk and test common package

* update http status

* add share function to common

* remove temp path

* remove /DATA directory initialization - moved to local-storage (#578)

* update goreleaser configuration

* wip

* change service type to notify for systemd so its status is OK only when service is initialized successfully

* update CasaOS-Common to fix runtime error

* wip

* add send notify function

* add shell script

* add system notiry

* remove disk and test common package

* update http status

* add share function to common

* remove temp path

* remove /DATA directory initialization - moved to local-storage (#578)

* update goreleaser configuration

* wip

* change service type to notify for systemd so its status is OK only when service is initialized successfully

* update CasaOS-Common to fix runtime error

* wip

* wip

* wip

* wip

* wip

* Utilization interface to supplement disk information

* fix upload file

* wip

* wip

* add update url

* wip

* wip

* add change log

* update changelog

* update release

Signed-off-by: link <a624669980@163.com>
Co-authored-by: Tiger Wang <tigerwang@outlook.com>
2022-10-26 15:46:40 +08:00
LinkLeong
ca967ec59c update release 2022-10-26 08:45:32 +01:00
Tiger Wang
c0b3260a6c
use $BASH instead of $SHELL in setup and cleanup script in case of running under non-bash shell. (#617)
fixes https://github.com/IceWhaleTech/CasaOS/issues/572
2022-10-21 13:40:31 -04:00
link
9ed82cd55e
Update CHANGELOG.md
Signed-off-by: link <a624669980@163.com>
2022-10-20 17:29:02 +08:00
Tiger Wang
381fb85b1d
v0.3.7 (#600)
* add send notify function

* add shell script

* add system notiry

* remove disk and test common package

* update http status

* add share function to common

* remove temp path

* remove /DATA directory initialization - moved to local-storage (#578)

* update goreleaser configuration

* wip

* change service type to notify for systemd so its status is OK only when service is initialized successfully

* update CasaOS-Common to fix runtime error

* wip

* add send notify function

* add shell script

* add system notiry

* remove disk and test common package

* update http status

* add share function to common

* remove temp path

* remove /DATA directory initialization - moved to local-storage (#578)

* update goreleaser configuration

* wip

* change service type to notify for systemd so its status is OK only when service is initialized successfully

* update CasaOS-Common to fix runtime error

* wip

* wip

* wip

* wip

* wip

* Utilization interface to supplement disk information

* fix upload file

* wip

* wip

* add update url

* wip

* wip

* add change log

* update changelog

Co-authored-by: LinkLeong <a624669980@163.com>
2022-10-20 14:25:26 +08:00
LinkLeong
2beb1c0d82 update changelog 2022-10-19 09:08:11 +01:00
LinkLeong
772c3e0bc0 Merge branch 'v0.3.7' of https://github.com/IceWhaleTech/CasaOS into v0.3.7 2022-10-19 09:00:57 +01:00
LinkLeong
bcda992322 add change log 2022-10-19 09:00:45 +01:00
link
8cec47e4db
Update demo.yml
Signed-off-by: link <a624669980@163.com>
2022-10-19 11:41:09 +08:00
Tiger Wang
87de9cec0a wip 2022-10-18 18:58:26 -04:00
Tiger Wang
6d47d4ff18 wip 2022-10-18 17:30:00 -04:00
LinkLeong
4bb81e4669 Merge branch 'v0.3.7' of https://github.com/IceWhaleTech/CasaOS into v0.3.7 2022-10-17 06:54:34 +01:00
LinkLeong
c05d837350 add update url 2022-10-17 06:53:23 +01:00
Tiger Wang
8908c39969 wip 2022-10-13 19:33:18 -04:00
Tiger Wang
df0f015944 wip 2022-10-13 16:09:19 -04:00
LinkLeong
46a37f0510 fix upload file 2022-10-13 11:32:30 +01:00
LinkLeong
6ea3cdb364 Utilization interface to supplement disk information 2022-10-13 04:45:17 +01:00
LinkLeong
be80d0cd95 Merge branch 'v0.3.7' of https://github.com/IceWhaleTech/CasaOS into v0.3.7 2022-10-13 04:32:13 +01:00
a624669980@163.com
296e88d099 Merge branch 'v0.3.7' of ssh://github.com/IceWhaleTech/CasaOS into v0.3.7 2022-10-13 11:16:52 +08:00
Tiger Wang
b61a3db611 wip 2022-10-12 16:12:14 -04:00
Tiger Wang
0f3d3e82f5 wip 2022-10-11 23:33:58 -04:00
Tiger Wang
dd66f73157 wip 2022-10-11 23:33:58 -04:00
Tiger Wang
cbbb907d6a wip 2022-10-11 23:33:58 -04:00
Tiger Wang
ff6cdb6fda wip 2022-10-11 23:33:58 -04:00
Tiger Wang
2eac040875 update CasaOS-Common to fix runtime error 2022-10-11 23:33:54 -04:00
Tiger Wang
b41d855f73 change service type to notify for systemd so its status is OK only when service is initialized successfully 2022-10-11 23:31:42 -04:00
Tiger Wang
182bc25343 wip 2022-10-11 23:31:42 -04:00
Tiger Wang
12d5e5db03 update goreleaser configuration 2022-10-11 23:31:42 -04:00
Tiger Wang
455d226dcd remove /DATA directory initialization - moved to local-storage (#578) 2022-10-11 23:31:42 -04:00
LinkLeong
f0448cd1b9 remove temp path 2022-10-11 23:31:42 -04:00
LinkLeong
aff18fa091 add share function to common 2022-10-11 23:31:42 -04:00
LinkLeong
80c347ac01 update http status 2022-10-11 23:31:42 -04:00
LinkLeong
8113f51cf7 remove disk and test common package 2022-10-11 23:31:42 -04:00
LinkLeong
4f491fa22f add system notiry 2022-10-11 23:31:42 -04:00
LinkLeong
3935489d8b add shell script 2022-10-11 23:31:37 -04:00
LinkLeong
d14381e6a2 add send notify function 2022-10-11 23:28:25 -04:00
Tiger Wang
42ebd5f325 wip 2022-10-11 00:19:02 -04:00
Tiger Wang
a51bf70b79 update CasaOS-Common to fix runtime error 2022-09-29 00:05:12 -04:00
Tiger Wang
3787c7bf99 change service type to notify for systemd so its status is OK only when service is initialized successfully 2022-09-28 18:19:31 -04:00
Tiger Wang
ec7f6573ad wip 2022-09-28 17:56:28 -04:00
Tiger Wang
50d68f3f76 update goreleaser configuration 2022-09-28 12:21:44 -04:00
Tiger Wang
d9c6a5c875
remove /DATA directory initialization - moved to local-storage (#578) 2022-09-28 11:14:19 -04:00
LinkLeong
4bace9b16a remove temp path 2022-09-28 16:13:42 +01:00
LinkLeong
84dfa7f5bf add share function to common 2022-09-19 10:09:04 +01:00
LinkLeong
582f85c3ba update http status 2022-09-16 04:47:42 +01:00
LinkLeong
7f4562629a remove disk and test common package 2022-09-15 08:13:07 +01:00
LinkLeong
4776b76b16 add system notiry 2022-09-13 07:22:24 +01:00
LinkLeong
466350dd21 update CasaOS-Common 2022-09-13 07:02:21 +01:00
LinkLeong
fb39529e8f update common package 2022-09-10 01:00:01 +01:00
LinkLeong
4434ba522b update upgrade script address 2022-09-09 07:36:49 +01:00
LinkLeong
aac8fe85ba update the way environment variables are displayed 2022-09-09 06:46:51 +01:00
a624669980@163.com
9f938f65b1 Merge branch 'main' into v0.3.7 2022-09-09 12:02:19 +08:00
a624669980@163.com
314dbdab57 add shell script 2022-09-09 11:28:30 +08:00
LinkLeong
4ccae3f67f add shell script 2022-09-09 04:12:34 +01:00
LinkLeong
9f2e8dae6f add send notify function 2022-09-08 10:55:20 +01:00
John Guan
727aca564b
Update CHANGELOG.md
Signed-off-by: John Guan <Guan.Ningchuan@gmail.com>
2022-09-06 20:40:14 +08:00
link
70ba4d5e3d
0.3.6 (#519)
* Add registration route

* add route registration

* remove ui

* 0.3.6 build scaffold (#473)

* wip

* wip

* wip

* Merge Branches

* Update helper.sh

* add goreleaser

* fix migration not working for LEGACY_WITHOUT_VERSION (#479)

* wip

* wip

* add error handling to migration script

* add migration tool

* Adjusting shell script location

* update disk user authentication method

* delayed port modification

* Update system.go

Co-authored-by: Tiger Wang (王豫) <tigerwang@outlook.com>
2022-09-06 14:28:49 +08:00
a624669980@163.com
8d088afcc5 update system version 2022-08-25 10:50:11 +08:00
link
34f35bbf20
0.3.5 (#470)
* initial completion of the sharing function

* Adjusting multi-partition disk mounts

* Add file sharing function

* update usb auto mount shell

* update samba config

* add umount disk function

* update change log

* update usb auto mount \

* update usb auto mount

* Update periodical.go

* Update periodical.go

* resolve alpha.1 issues

* Update UI

* update usb show name

* update web

* update image version
2022-08-22 18:22:12 +08:00
link
b6f413b9e9
0.3.5 (#464)
* initial completion of the sharing function

* Adjusting multi-partition disk mounts

* Add file sharing function

* update usb auto mount shell

* update samba config

* add umount disk function

* update change log

* update usb auto mount \

* update usb auto mount

* Update periodical.go

* Update periodical.go

* resolve alpha.1 issues

* Update UI
2022-08-18 11:18:27 +08:00
John Guan
091be6d12e Update push_events_to_discord.yml 2022-08-17 15:49:44 +08:00
John Guan
aefa68d8f8 Merge branch 'main' of https://github.com/IceWhaleTech/CasaOS 2022-08-16 14:23:28 +08:00
John Guan
9aed323d8d Update push_events_to_discord.yml 2022-08-16 14:23:25 +08:00
John Guan
eba607fc53 Revert "Update push_events_to_discord.yml"
This reverts commit d064f20a0468ee1819dbb3a05ce86c466adaafa8.
2022-08-15 15:52:20 +08:00
John Guan
d064f20a04 Update push_events_to_discord.yml 2022-08-15 15:46:56 +08:00
link
079e431d33
0.3.5 (#452)
* initial completion of the sharing function

* Adjusting multi-partition disk mounts

* Add file sharing function

* update usb auto mount shell

* update samba config

* add umount disk function

* update change log

* update usb auto mount \

* update usb auto mount

* Update periodical.go

* Update periodical.go
2022-08-15 11:51:29 +08:00
link
cee34ec1c2
0.3.5 (#451)
* initial completion of the sharing function

* Adjusting multi-partition disk mounts

* Add file sharing function

* update usb auto mount shell

* update samba config

* add umount disk function

* update change log

* update usb auto mount \

* update usb auto mount

* Update periodical.go
2022-08-15 11:37:21 +08:00
John Guan
848ee63386 Update app_request.yaml 2022-08-12 11:40:37 +08:00
John Guan
c12c6cc940 Update app_request.yaml 2022-08-12 11:27:20 +08:00
John Guan
f31fb22039 Update alpha_bug_report.yaml 2022-08-12 11:27:17 +08:00
John Guan
a5133bdbfa Merge branch 'main' of https://github.com/IceWhaleTech/CasaOS 2022-08-10 14:44:32 +08:00
John Guan
1902b2d4f2 Update bug_report.md 2022-08-10 14:44:29 +08:00
John Guan
fc5e351f0b
Update push_events_to_discord.yml 2022-08-10 11:18:14 +08:00
John Guan
7f642a7a4c
Update push_events_to_discord.yml 2022-08-10 10:31:46 +08:00
John Guan
c36a046a15
Update and rename move_issues_to_projects.yml to add_issues_to_projects.yml 2022-08-08 17:31:38 +08:00
John Guan
8b2c9486da
Update push_events_to_discord.yml 2022-08-08 17:30:30 +08:00
John Guan
ce5ecfcf84
Rename move_issue_to_project.yml to move_issues_to_projects.yml 2022-08-08 15:41:00 +08:00
John Guan
bd1a2f5751
Update move_issue_to_project.yml 2022-08-08 15:40:43 +08:00
John Guan
d2e0695d73
Create push_events_to_discord.yml 2022-08-08 15:40:05 +08:00
John Guan
8cd18c3218
Create move_issue_to_project.yml 2022-08-05 16:37:46 +08:00
John Guan
cc0ba82c92 Update config.yml 2022-08-05 15:58:43 +08:00
John Guan
ddca242d23 Update app_request.yaml 2022-08-05 15:49:42 +08:00
John Guan
eaa07ba95a Update app_request.yaml 2022-08-05 12:21:54 +08:00
John Guan
39a4c29680 Update app_request.yaml 2022-08-04 20:55:03 +08:00
John Guan
af6900b1c7 Create app_request.yaml 2022-08-04 20:53:30 +08:00
John Guan
9ec43a7691 Update config.yml 2022-08-04 17:37:19 +08:00
a624669980@163.com
bd85cda9fa update check version 2022-07-29 16:23:53 +08:00
a624669980@163.com
94eaba6ecb Update jwt_helper.go 2022-07-29 16:14:50 +08:00
a624669980@163.com
e207c9c75f Update CHANGELOG.md 2022-07-29 15:50:31 +08:00
a624669980@163.com
81d3293991 Update route.go 2022-07-29 15:47:43 +08:00
link
364fbf01f5
0.3.4 (#412)
* delete connect

* update user

* change branch

* API feedback (#341)

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* change branch

* update route

* change branch

* Update route.go

* 0.3.4 Function development completed

* Update system.go

* update ui

* Completed v0.3.4 and released alpha

* Update gin.go

* fix the problem of docker environment variables being displayed more than once

* update update shell

Co-authored-by: Tiger Wang (王豫) <tigerwang@outlook.com>
2022-07-27 18:37:22 +08:00
link
87e66aae8a
0.3.4 (#408)
* delete connect

* update user

* change branch

* API feedback (#341)

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* change branch

* update route

* change branch

* Update route.go

* 0.3.4 Function development completed

* Update system.go

* update ui

* Completed v0.3.4 and released alpha

* Update gin.go

* fix the problem of docker environment variables being displayed more than once

Co-authored-by: Tiger Wang (王豫) <tigerwang@outlook.com>
2022-07-26 11:03:45 +08:00
a624669980@163.com
3a60db3729 solve the first time app store opening failure problem 2022-07-22 15:24:13 +08:00
a624669980@163.com
d3f78b52fa Delete alpha.md 2022-07-22 11:27:05 +08:00
a624669980@163.com
7d67a66d6b update change log 2022-07-22 11:19:25 +08:00
a624669980@163.com
cb9e1b9dd9 Merge branch 'main' of ssh://github.com/IceWhaleTech/CasaOS 2022-07-22 11:18:05 +08:00
a624669980@163.com
dc8282acbb update chage log 2022-07-22 11:17:33 +08:00
link
cf6103a2b5
0.3.4 (#386)
* delete connect

* update user

* change branch

* API feedback (#341)

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* change branch

* update route

* change branch

* Update route.go

* 0.3.4 Function development completed

* Update system.go

* update ui

* Completed v0.3.4 and released alpha

* Update gin.go

Co-authored-by: Tiger Wang (王豫) <tigerwang@outlook.com>
2022-07-22 11:09:05 +08:00
link
6f98995e7d
0.3.4 (#385)
* delete connect

* update user

* change branch

* API feedback (#341)

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* change branch

* update route

* change branch

* Update route.go

* 0.3.4 Function development completed

* Update system.go

* update ui

* Completed v0.3.4 and released alpha

Co-authored-by: Tiger Wang (王豫) <tigerwang@outlook.com>
2022-07-22 11:02:11 +08:00
link
5cc41fa040
Update demo.yml 2022-07-21 19:17:46 +08:00
John Guan
cb289f5b8a
Update move_alpha_bug_to_project.yml 2022-07-21 00:07:19 +08:00
John Guan
1377d55407
Create move_alpha_bug_to_project.yml 2022-07-21 00:06:03 +08:00
John Guan
06eca38022 Update alpha_bug_report.yaml 2022-07-20 19:14:33 +08:00
John Guan
c47c1e548c Update alpha_bug_report.yaml 2022-07-20 19:12:57 +08:00
John Guan
552ec4849d Update alpha_bug_report.yaml 2022-07-20 19:11:10 +08:00
John Guan
7386a9dce3 Update alpha_bug_report.yaml 2022-07-20 19:07:50 +08:00
John Guan
b2b1daf5ab Update alpha_bug_report.yaml 2022-07-20 19:06:56 +08:00
John Guan
bbc0181e23 Create alpha_bug_report.yaml 2022-07-20 19:04:47 +08:00
allcontributors[bot]
c23bd3f3a3
docs: add llwaini as a contributor for projectManagement, test, tutorial (#379)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-07-19 18:10:25 +08:00
allcontributors[bot]
8a1839c02e
docs: add Protektor-Desura as a contributor for bug, ideas, question (#378)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-07-19 12:09:20 +08:00
allcontributors[bot]
164bf66190
docs: add bearfrieze as a contributor for ideas (#377)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-07-19 12:03:18 +08:00
allcontributors[bot]
a4c2a4b992
docs: add sio as a contributor for ideas (#376)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-07-19 12:01:47 +08:00
allcontributors[bot]
e7e82e6ca3
docs: add Joooost as a contributor for ideas (#375)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-07-19 12:00:06 +08:00
allcontributors[bot]
574295470e
docs: add DrMxrcy as a contributor for test, ideas, question (#374)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-07-19 11:58:08 +08:00
allcontributors[bot]
b1061f19ad
docs: add baptiste313 as a contributor for translation (#372)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-07-19 00:03:57 +08:00
John Guan
bdd9eaca9f Update .all-contributorsrc 2022-07-19 00:01:26 +08:00
allcontributors[bot]
ec4c672924
docs: add AuthorShin as a contributor for test, bug, question, test, ideas (#371)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-07-18 23:58:25 +08:00
allcontributors[bot]
5d4717de4d
docs: add zarevskaya as a contributor for mentoring, question, tutorial, translation (#370)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-07-18 23:49:58 +08:00
allcontributors[bot]
e2de783152
docs: add dtaivpp as a contributor for doc, ideas, question (#369)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-07-18 23:22:09 +08:00
allcontributors[bot]
09f68f4034
docs: add JohnGuan as a contributor for bug, blog, content, doc, ideas, eventOrganizing, mentoring, question, translation, review, video (#368)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-07-18 23:19:31 +08:00
allcontributors[bot]
cec83fc048
docs: add Lauren-ED209 as a contributor for ideas, fundingFinding, projectManagement, question, test (#367)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-07-18 23:15:26 +08:00
allcontributors[bot]
33e1d8a806
docs: add tigerinus as a contributor for code, doc, ideas, infra, maintenance, mentoring, security, question, review (#366)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-07-18 23:13:01 +08:00
allcontributors[bot]
2a8dafae28
docs: add LinkLeong as a contributor for code, doc, ideas, infra, maintenance, question, review (#365)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-07-18 23:09:06 +08:00
John Guan
a426b56306 Update README.md 2022-07-18 23:04:47 +08:00
John Guan
6202d38bdb Update .all-contributorsrc 2022-07-18 23:04:46 +08:00
allcontributors[bot]
4626ceb048
docs: add jerrykuku as a contributor for code, doc, ideas, infra, maintenance, platform, question, review (#364)
* docs: update README.md [skip ci]

* docs: create .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-07-18 22:39:00 +08:00
John Guan
1e7333118c Revert "Create .all-contributorsrc"
This reverts commit 9758436a1e78a9c9266e00dbe6d7aa0edb8c7f62.
2022-07-18 22:29:59 +08:00
John Guan
9758436a1e Create .all-contributorsrc 2022-07-18 22:25:49 +08:00
John Guan
ed67e977b7 Update README.md 2022-07-18 22:02:00 +08:00
John Guan
b0b1b5e262 Update README.md 2022-07-18 18:56:21 +08:00
John Guan
2796c37bf6 Update README.md 2022-07-18 18:52:54 +08:00
John Guan
d48e24f652 Create snapshot-dark.jpg 2022-07-18 18:52:50 +08:00
John Guan
3a8cf593d9 Create snapshot-light.jpg 2022-07-18 18:52:48 +08:00
a624669980@163.com
0ffa2f901a update readme 2022-07-08 14:12:23 +08:00
a624669980@163.com
bd73141ddf Fix file cut failure 2022-07-04 18:07:06 +08:00
a624669980@163.com
346b0f5d97 Update .gitignore 2022-07-01 15:54:02 +08:00
a624669980@163.com
d4b4b75012 delete conf.con 2022-07-01 15:53:04 +08:00
a624669980@163.com
cb33ffbb46 Update alpha.md 2022-07-01 15:51:33 +08:00
a624669980@163.com
85188d0b05 Merge branch 'main' of ssh://github.com/IceWhaleTech/CasaOS 2022-07-01 15:51:08 +08:00
a624669980@163.com
1e60c26920 Update .gitignore 2022-07-01 15:50:33 +08:00
link
752134942a
V0.3.3 (#334)
* switch branches

* update user interface

* switch branch

* switch branch

* change branch

* submit 0.3.3

* Update UI

* update version function

* Update UI

* Update user.go

* update disk

* update person info interface

* Update main.go

* Update UI

* update alpha

* updata ui

* Update assist.sh

* Update assist.sh

* update update function

* add upload sh

* Update init.go

* upload shell script

* Update system.go

* update update.sh

* Update init.go

* update update.sh

* update update.sh

* Update update.sh

* Update system.go

* Update system.go

* update UI

* Update CHANGELOG.md
2022-07-01 15:19:16 +08:00
link
faf683a02c
V0.3.3 (#331)
* switch branches

* update user interface

* switch branch

* switch branch

* change branch

* submit 0.3.3

* Update UI
2022-06-29 11:22:12 +08:00
link
f99f49dd7e
V0.3.3 (#330)
* switch branches

* update user interface

* switch branch

* switch branch

* change branch

* submit 0.3.3
2022-06-29 11:09:58 +08:00
David Tippett
b0dc30277b
Adding simple Developing file (#311)
* Adding developing guide with env setup

Signed-off-by: David Tippett <dtaivpp@gmail.com>

* Fixing formatting on developing guide

Signed-off-by: David Tippett <dtaivpp@gmail.com>

* Switching nav to bulleted list

Signed-off-by: David Tippett <dtaivpp@gmail.com>

* Forgot a word o_o

Signed-off-by: David Tippett <dtaivpp@gmail.com>
2022-06-21 08:57:55 +08:00
a624669980@163.com
d91fef0a19 Update route.go 2022-06-16 21:20:10 +08:00
a624669980@163.com
6bb044ab04 Update version.go 2022-06-16 20:11:11 +08:00
a624669980@163.com
78479f9604 Update file.go 2022-06-16 16:57:13 +08:00
a624669980@163.com
8fe893847f Update CHANGELOG.md 2022-06-16 15:52:50 +08:00
link
f506d6ce49
Dev (#298)
* fix bug

* updata UI

* 0.3.2

### 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.
- [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))
### 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))

* Modify log help class

* Fix some bugs in 0.3.2

* Solve the operation file queue problem

* Exclude web folders

* update UI

* add cancel file operate

* Update UI

* Merge sockets to transfer data

* Conflict Resolution

* Update send data interval

* Update UI

* fixed bug

- Fix the problem of application opening failure on non-80 ports
- Modify port failure problem
- Modify environment variables disappearing problem

* update version function

* Fix version update issues

* fixed bug

- [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)

* update UI

* Update CHANGELOG.md

* update app service

* update ui

* Fix application installation host mode error

* update ui

* Update UI
2022-06-15 19:01:26 +08:00
link
5d7c5ba120
Dev (#296)
* fix bug

* updata UI

* 0.3.2

### 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.
- [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))
### 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))

* Modify log help class

* Fix some bugs in 0.3.2

* Solve the operation file queue problem

* Exclude web folders

* update UI

* add cancel file operate

* Update UI

* Merge sockets to transfer data

* Conflict Resolution

* Update send data interval

* Update UI

* fixed bug

- Fix the problem of application opening failure on non-80 ports
- Modify port failure problem
- Modify environment variables disappearing problem

* update version function

* Fix version update issues

* fixed bug

- [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)

* update UI

* Update CHANGELOG.md

* update app service

* update ui
2022-06-15 10:22:27 +08:00
link
eedffd7c19
Dev (#292)
* fix bug

* updata UI

* 0.3.2

### 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.
- [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))
### 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))

* Modify log help class

* Fix some bugs in 0.3.2

* Solve the operation file queue problem

* Exclude web folders

* update UI

* add cancel file operate

* Update UI

* Merge sockets to transfer data

* Conflict Resolution

* Update send data interval

* Update UI

* fixed bug

- Fix the problem of application opening failure on non-80 ports
- Modify port failure problem
- Modify environment variables disappearing problem

* update version function

* Fix version update issues

* fixed bug

- [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)

* update UI

* Update CHANGELOG.md
2022-06-14 18:22:02 +08:00
link
0885c1386d
Dev (#291)
* fix bug

* updata UI

* 0.3.2

### 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.
- [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))
### 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))

* Modify log help class

* Fix some bugs in 0.3.2

* Solve the operation file queue problem

* Exclude web folders

* update UI

* add cancel file operate

* Update UI

* Merge sockets to transfer data

* Conflict Resolution

* Update send data interval

* Update UI

* fixed bug

- Fix the problem of application opening failure on non-80 ports
- Modify port failure problem
- Modify environment variables disappearing problem

* update version function

* Fix version update issues

* fixed bug

- [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)

* update UI
2022-06-14 18:11:15 +08:00
link
0297fe67af
Dev (#290)
* fix bug

* updata UI

* 0.3.2

### 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.
- [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))
### 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))

* Modify log help class

* Fix some bugs in 0.3.2

* Solve the operation file queue problem

* Exclude web folders

* update UI

* add cancel file operate

* Update UI

* Merge sockets to transfer data

* Conflict Resolution

* Update send data interval

* Update UI

* fixed bug

- Fix the problem of application opening failure on non-80 ports
- Modify port failure problem
- Modify environment variables disappearing problem

* update version function

* Fix version update issues

* fixed bug

- [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)

* update UI
2022-06-14 18:10:22 +08:00
link
3f53e6f33b
Dev (#288)
* fix bug

* updata UI

* 0.3.2

### 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.
- [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))
### 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))

* Modify log help class

* Fix some bugs in 0.3.2

* Solve the operation file queue problem

* Exclude web folders

* update UI

* add cancel file operate

* Update UI

* Merge sockets to transfer data

* Conflict Resolution

* Update send data interval

* Update UI

* fixed bug

- Fix the problem of application opening failure on non-80 ports
- Modify port failure problem
- Modify environment variables disappearing problem

* update version function

* Fix version update issues
2022-06-14 13:24:53 +08:00
link
94d0efdb12
Dev (#285)
* fix bug

* updata UI

* 0.3.2

### 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.
- [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))
### 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))

* Modify log help class

* Fix some bugs in 0.3.2

* Solve the operation file queue problem

* Exclude web folders

* update UI

* add cancel file operate

* Update UI

* Merge sockets to transfer data

* Conflict Resolution

* Update send data interval

* Update UI

* fixed bug

- Fix the problem of application opening failure on non-80 ports
- Modify port failure problem
- Modify environment variables disappearing problem
2022-06-13 20:43:19 +08:00
link
1e821d1c10
Dev (#277)
* fix bug

* updata UI

* 0.3.2

### 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.
- [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))
### 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))

* Modify log help class

* Fix some bugs in 0.3.2

* Solve the operation file queue problem

* Exclude web folders

* update UI

* add cancel file operate

* Update UI

* Merge sockets to transfer data

* Conflict Resolution

* Update send data interval

* Update UI
2022-06-10 15:32:27 +08:00
link
2c80b53ee8
Dev (#276)
* fix bug

* updata UI

* 0.3.2

### 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.
- [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))
### 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))

* Modify log help class

* Fix some bugs in 0.3.2

* Solve the operation file queue problem

* Exclude web folders

* update UI

* add cancel file operate

* Update UI

* Merge sockets to transfer data

* Conflict Resolution

* Update send data interval
2022-06-10 15:16:56 +08:00
link
c33af66c6e
Dev (#275)
* fix bug

* updata UI

* 0.3.2

### 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.
- [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))
### 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))

* Modify log help class

* Fix some bugs in 0.3.2

* Solve the operation file queue problem

* Exclude web folders

* update UI

* add cancel file operate

* Update UI

* Merge sockets to transfer data

* Conflict Resolution

* Update send data interval
2022-06-10 14:47:50 +08:00
link
9d47874ae3
Dev (#274)
* fix bug

* updata UI

* 0.3.2

### 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.
- [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))
### 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))

* Modify log help class

* Fix some bugs in 0.3.2

* Solve the operation file queue problem

* Exclude web folders

* update UI

* add cancel file operate

* Update UI

* Merge sockets to transfer data

* Conflict Resolution
2022-06-10 13:33:53 +08:00
link
c7b7a30210
Dev (#264)
* fix bug

* updata UI

* 0.3.2

### 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.
- [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))
### 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))

* Modify log help class

* Fix some bugs in 0.3.2

* Solve the operation file queue problem

* Exclude web folders

* update UI

* add cancel file operate

* Update UI
2022-06-08 19:44:05 +08:00
link
fde665cd4d
Dev (#263)
* fix bug

* updata UI

* 0.3.2

### 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.
- [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))
### 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))

* Modify log help class

* Fix some bugs in 0.3.2

* Solve the operation file queue problem

* Exclude web folders

* update UI

* add cancel file operate
2022-06-08 19:32:05 +08:00
link
eaf2341a2a
Dev (#262)
* fix bug

* updata UI

* 0.3.2

### 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.
- [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))
### 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))

* Modify log help class

* Fix some bugs in 0.3.2

* Solve the operation file queue problem

* Exclude web folders

* update UI

* add cancel file operate
2022-06-08 19:31:01 +08:00
link
d4bed3e5c7
Dev (#261)
* fix bug

* updata UI

* 0.3.2

### 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.
- [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))
### 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))

* Modify log help class

* Fix some bugs in 0.3.2

* Solve the operation file queue problem

* Exclude web folders

* update UI
2022-06-08 18:19:45 +08:00
Tiger Wang (王豫)
fcb2b3f5a5
Create config.yml 2022-06-02 20:30:00 -04:00
link
60349c941a
Update demo.yml 2022-05-18 16:59:43 +08:00
link
11bc70a710
Update demo.yml 2022-05-18 16:58:33 +08:00
link
665766019f
Update demo.yml 2022-05-18 16:39:59 +08:00
link
57cef9624c
Dev (#199)
* fix bug

* updata UI
2022-05-17 16:31:23 +08:00
link
6bd41ad016
fix bug (#198) 2022-05-17 12:57:34 +08:00
link
05425d638f
Update CHANGELOG.md 2022-05-16 20:45:38 +08:00
link
bd5a2e35d4
update ui (#192) 2022-05-16 15:57:54 +08:00
link
123e7e8758
Merge pull request #183 from IceWhaleTech/dev
Update UI
2022-05-13 20:27:53 +08:00
LinkLeong
1ec3e2e9fb Update UI 2022-05-13 20:27:26 +08:00
link
0719c3cc0c
Merge pull request #182 from IceWhaleTech/dev
update api url
2022-05-13 19:11:28 +08:00
LinkLeong
0a4ceb7c4c update api url 2022-05-13 19:09:35 +08:00
link
655f59f00a
Merge pull request #181 from IceWhaleTech/dev
Dev
2022-05-13 18:56:35 +08:00
LinkLeong
5289f471d6 Update .gitignore 2022-05-13 18:55:52 +08:00
LinkLeong
59597befb6 delete github.com 2022-05-13 18:55:34 +08:00
link
df2477a12f
Merge pull request #179 from IceWhaleTech/dev
Dev
2022-05-13 18:21:44 +08:00
LinkLeong
b709abe682 Merge branch 'main' into dev 2022-05-13 18:15:56 +08:00
LinkLeong
d0f3dc806e New Feature
- [Apps] This is a feature that has been highly requested by the community. Import the original Docker application into CasaOS. Now it's easy to import with just a few clicks!
- [Apps] App list supports a custom sorting function! You can arrange apps in different orders by dragging the icons.
- [Apps] App custom installation supports Docker Compose configuration import in YAML format.
- [Files] Added thumbnail preview function for image files.
- [Connect] Multiple CasaConenct devices in the LAN will be transmitted through the LAN network.
- [System] Added a switch for auto-mounting USB disk devices.

🎈 Enhancement
- [System] Optimized the system update alert, you will see the new version update log from the next version.
- [Apps] Added live preview for icons in custom installed apps.
- [Apps] Optimized the input of WebUI.
- [Files] Completely updated the image preview, now it supports switching all images in the same folder, as well as dragging, zooming, rotating and resetting.
- [Widgets] Added color levels for CPU and RAM charts.
- [Conenct] Optimized the display of the right-click menu of the Connect friends list.

🎈 Changed
- [Files] Change the initial display directory to /DATA

🐞 Fixed
- [System] Fixed an issue with Raspberry Pi devices failing to boot using USB disks. (Achieved by disabling USB disk auto-mount)
- [Apps] Fixed the issue that some Docker CLI commands failed to import.
- [Apps] Fixed the issue that the app is not easily recognized in /DATA/AppData directory and docker command line after installation, it will be shown as the app name. (Newly installed apps only)
- [Apps] Fixed the issue that Pi-hole cannot be launched after installation in the app store.
- [Apps] Fixed the issue that apps cannot be updated with WatchTower.
- [Files] Fixed the issue that when there is an upload task, the task status is lost after closing Files.
2022-05-13 18:12:26 +08:00
LinkLeong
92d085acf9 update changelog 2022-05-05 13:46:55 +08:00
link
20dbae21c8
Update github.go 2022-04-24 17:53:57 +08:00
link
9258cb4b9e
Merge pull request #151 from IceWhaleTech/dev
Update UI
2022-04-08 14:44:28 +08:00
link
d9794851f9 Update UI 2022-04-08 14:44:02 +08:00
link
1fcb530ff2
Merge pull request #149 from IceWhaleTech/dev
Update UI
2022-04-07 16:20:19 +08:00
link
364d411438 Update UI 2022-04-07 16:17:47 +08:00
link
0dacc5db12
Merge pull request #141 from igorpecovnik/patch-1
Tested on Rockpro64, Odroid C2, Neo2, Cubox-i, amd64
2022-04-06 12:14:38 +08:00
link
fcbff194d2
Merge branch 'main' into patch-1 2022-04-06 12:14:31 +08:00
link
04e93b0e3c
Merge pull request #138 from alvarosamudio/main
add a new OS to systems
2022-04-06 12:12:07 +08:00
link
2eff7fa8bc
Merge pull request #148 from IceWhaleTech/dev
Dev
2022-04-06 12:11:39 +08:00
link
dd0645ee0f Add CasaConnect function 2022-04-06 12:10:51 +08:00
Igor Pečovnik
c93aa6286e
Tested on Rockpro64, Odroid C2, Neo2, Cubox-i, x86
Basically it should work on all.
https://www.armbian.com/download/
https://docs.armbian.com/#what-is-the-difference-between-armbian-and-debianubuntu
2022-03-29 15:57:16 +02:00
Alvaro Samudio
bf7b32309f
add Elementary OS 6.1 Jólnir to systems 2022-03-25 14:49:21 +00:00
Alvaro Samudio
cd779448ce
add Deepin to systems 2022-03-25 14:41:05 +00:00
link
c3b2c1d599 Merge branch 'main' into dev 2022-03-18 11:41:04 +08:00
link
b7949e100f Merge Branches 2022-03-18 11:40:38 +08:00
link
80d24570d6
Merge pull request #130 from IceWhaleTech/Adding-ipv6-Support
fixed
2022-03-18 11:31:05 +08:00
link
539b72a388 fixed 2022-03-18 11:30:06 +08:00
link
a7d15a896e Need to fix bugs 2022-03-18 11:13:07 +08:00
link
9796c5aad7 prepare for test 2022-03-16 15:41:14 +08:00
link
892cd99eb3 Add some acquaintance network interface 2022-03-11 18:01:09 +08:00
link
02cb4cd392
Merge pull request #126 from IceWhaleTech/dev
fixed file upload bug
2022-03-10 16:26:00 +08:00
link
9213f9e379 fixed file upload bug 2022-03-10 16:25:33 +08:00
link
4473056d5c
Merge pull request #125 from IceWhaleTech/dev
upload file manage
2022-03-10 13:41:15 +08:00
link
07e96511cd upload file manage 2022-03-10 13:40:42 +08:00
link
ce1dc52bc2
Merge pull request #123 from IceWhaleTech/dev
update file
2022-03-09 19:44:47 +08:00
link
d890b16644 update file 2022-03-09 19:44:08 +08:00
link
5737936318
Merge pull request #122 from IceWhaleTech/dev
Dev
2022-03-09 16:38:18 +08:00
link
33acfababd new file manager
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.
2022-03-09 16:37:03 +08:00
link
28c1a52171 Determine the hole punching technique 2022-02-28 14:14:39 +08:00
link
892eef424c Merge branch 'main' into dev 2022-02-18 19:14:30 +08:00
link
f3c73ba79b Update usb-mount.sh 2022-02-18 19:14:11 +08:00
link
c6928c333d Add websocket 2022-02-18 19:06:03 +08:00
link
63c6c2cebb
Merge pull request #111 from IceWhaleTech/dev
Delete CasaOS-linux-amd64
2022-02-17 19:22:14 +08:00
link
6cba025679 Delete CasaOS-linux-amd64 2022-02-17 19:21:19 +08:00
link
d25b93c972
Merge pull request #110 from IceWhaleTech/dev
Dev
2022-02-17 18:53:54 +08:00
link
b14861703c Merge branch 'dev' of ssh://github.com/IceWhaleTech/CasaOS into dev 2022-02-17 18:53:29 +08:00
link
32604225ce update ui 2022-02-17 18:52:14 +08:00
link
f623b29c38
Merge pull request #109 from IceWhaleTech/dev
Dev
2022-02-17 18:47:44 +08:00
link
94ae6ee8ec
Merge branch 'main' into dev 2022-02-17 18:47:36 +08:00
link
5115bf72e1 update desc 2022-02-17 18:44:51 +08:00
link
e1a928cd78 Fixed issues 2022-02-17 18:43:25 +08:00
link
3977519c43
Update assist.sh 2022-01-30 11:21:24 +08:00
link
2f87834ac9
Merge pull request #93 from IceWhaleTech/dev
Update route.go
2022-01-28 16:25:01 +08:00
link
53335012d8 Update route.go 2022-01-28 16:24:28 +08:00
link
9d6302f7e3
Merge pull request #92 from IceWhaleTech/dev
Update UI
2022-01-28 16:14:59 +08:00
link
20950e2a60 Update UI 2022-01-28 16:14:35 +08:00
link
0e0e507f8f
Merge pull request #91 from IceWhaleTech/dev
update ui
2022-01-28 15:35:15 +08:00
link
46e14617b6 update ui 2022-01-28 15:34:32 +08:00
link
903c73fafb
Merge pull request #90 from IceWhaleTech/dev
update web
2022-01-28 14:33:40 +08:00
link
42a56df4a5 update web 2022-01-28 14:32:49 +08:00
link
493dc5c032
Merge pull request #89 from IceWhaleTech/dev
Compatible with more types of disks
2022-01-28 14:06:58 +08:00
link
9a73bc2a18 Compatible with more types of disks
Add usb display
2022-01-28 14:06:27 +08:00
link
55a9acd9f6
Merge pull request #85 from IceWhaleTech/dev
Apply multilingual support
2022-01-26 18:51:14 +08:00
link
d060968b7a Apply multilingual support 2022-01-26 18:50:34 +08:00
link
88a7f53130
Merge pull request #82 from IceWhaleTech/dev
Dev
2022-01-26 11:33:33 +08:00
link
26e5b18a5d Merge branch 'dev' of ssh://github.com/IceWhaleTech/CasaOS into dev 2022-01-26 11:33:02 +08:00
link
011ace96f6 update ui 2022-01-26 11:32:57 +08:00
link
5c00655d14
Merge pull request #81 from IceWhaleTech/dev
Dev
2022-01-26 10:46:50 +08:00
link
eb36c262db
Merge branch 'main' into dev 2022-01-26 10:46:43 +08:00
link
29d1861545 Merge branch 'main' into dev 2022-01-26 10:45:11 +08:00
link
3c9b410693 update dependency 2022-01-26 10:44:55 +08:00
link
4c3b41433b
Update assist.sh 2022-01-24 22:06:31 +08:00
link
1fd13668c0
Merge pull request #78 from IceWhaleTech/dev
Dev
2022-01-24 17:22:48 +08:00
link
d1ab7261a6 Update usb-mount.sh 2022-01-24 17:21:43 +08:00
link
0fc65bcb3a update mount path 2022-01-24 17:08:28 +08:00
link
f1ce8bfd99
Merge pull request #77 from IceWhaleTech/dev
update disk
2022-01-24 11:19:47 +08:00
link
3f472f1864 update disk 2022-01-24 11:19:04 +08:00
link
229d94cae7
Merge pull request #74 from IceWhaleTech/dev
Fixed Storage Panel
2022-01-21 17:50:44 +08:00
link
c28e1bbf93 Fixed Storage Panel 2022-01-21 17:50:12 +08:00
link
a840029000
Merge pull request #73 from IceWhaleTech/dev
update UI
2022-01-20 18:45:54 +08:00
link
aad2646cf2 Merge branch 'dev' of ssh://github.com/IceWhaleTech/CasaOS into dev 2022-01-20 18:45:17 +08:00
link
ca1f8ad73e Update UI 2022-01-20 18:44:55 +08:00
link
dea02763a2 Update UI 2022-01-20 18:44:40 +08:00
link
ea67385a64
Merge pull request #72 from IceWhaleTech/dev
Storage Manager
2022-01-20 18:41:56 +08:00
link
fa2daa2767
Merge branch 'main' into dev 2022-01-20 18:41:49 +08:00
link
fcb906aa85 Storage Manager
Fix the app store classification problem
Fix the application market classification problem
2022-01-20 18:38:59 +08:00
老竭力
489a617126
Update casa.yml 2022-01-04 16:22:38 +08:00
老竭力
601e7ce10b
Update casa.yml 2022-01-04 14:51:09 +08:00
老竭力
4a6fc9a945
Update system.go 2022-01-04 14:47:46 +08:00
老竭力
b377af1d24
Update casa.yml 2021-12-30 19:17:11 +08:00
老竭力
3fc00f8da7
Update casa.yml 2021-12-30 19:13:40 +08:00
老竭力
6e39fe5f8c
Update casa.yml 2021-12-30 19:04:37 +08:00
老竭力
20c240a123
Update casa.yml 2021-12-30 19:00:11 +08:00
老竭力
3ea9fc0de0
Update casa.yml 2021-12-30 18:52:37 +08:00
老竭力
b80b08ef07
Update casa.yml 2021-12-30 18:50:45 +08:00
老竭力
505af8d101
Update casa.yml 2021-12-30 18:46:17 +08:00
老竭力
ae35a6d291
Update casa.yml 2021-12-30 18:44:07 +08:00
John Guan
2b95c07a47
Update casa.yml 2021-12-30 18:16:19 +08:00
John Guan
27a011e715
Update casa.yml 2021-12-30 18:01:01 +08:00
link
476831a12f
Merge pull request #65 from IceWhaleTech/dev
update action system
2021-12-30 16:59:05 +08:00
link
9675eff69e update action system 2021-12-30 16:58:24 +08:00
link
85a044246e
Merge pull request #64 from IceWhaleTech/dev
update action system
2021-12-30 16:53:32 +08:00
link
5c41fbcf3d update action system 2021-12-30 16:52:58 +08:00
link
6baab7a525
Merge pull request #63 from IceWhaleTech/dev
update action system
2021-12-30 16:42:39 +08:00
link
ab3b5a9077 update action system 2021-12-30 16:41:16 +08:00
link
5811c271b2
Merge pull request #62 from IceWhaleTech/dev
update web
2021-12-30 16:20:50 +08:00
link
cf5387346d update web 2021-12-30 16:20:30 +08:00
link
8df63c6c5c
Merge pull request #60 from IceWhaleTech/dev
New App Store
2021-12-29 16:42:56 +08:00
link
1d17d27c96 New App Store 2021-12-29 16:42:20 +08:00
John Guan
bdcbae69a5 Update README.md 2021-12-14 11:41:42 +08:00
John Guan
cdbc3437be Update README.md 2021-12-14 10:40:17 +08:00
link
8940b520e0
Merge pull request #53 from IceWhaleTech/dev
update ui
2021-12-11 15:44:55 +08:00
link
1d62fbd670 update ui 2021-12-11 15:44:17 +08:00
link
a0b56d809e
Merge pull request #52 from IceWhaleTech/dev
update cpu changes when the application is removed
2021-12-10 18:08:49 +08:00
link
f1f6d33e26 update cpu changes when the application is removed 2021-12-10 18:08:02 +08:00
link
f292edd2ba
Merge pull request #51 from IceWhaleTech/dev
update app.go
2021-12-10 17:14:46 +08:00
link
caa9b50b65 update app.go 2021-12-10 17:14:01 +08:00
link
61b824065b
Merge pull request #50 from IceWhaleTech/dev
update stats steam
2021-12-10 16:34:29 +08:00
link
9a900b2ca0 update stats steam 2021-12-10 16:33:39 +08:00
link
4c1cbc98a4
Merge pull request #49 from IceWhaleTech/dev
fixed bug
2021-12-10 14:18:01 +08:00
link
8660b95756 fixed bug 2021-12-10 14:17:36 +08:00
link
e7ebdc040f
Merge pull request #48 from IceWhaleTech/dev
feat: Multiple updates
2021-12-09 19:03:45 +08:00
link
6c235d3f2a feat: Multiple updates
1.Add the function of modifying the WebUI port.
2.Add the function to modify the search engine.
3.Add the multi-language function and add Chinese translation.
4.Add detailed CPU and memory statistics.
2021-12-09 19:02:41 +08:00
link
997d912f4d Merge branch 'main' into dev 2021-12-06 17:12:53 +08:00
link
2508a4e07d Pull Submit 2021-12-06 17:08:36 +08:00
link
90b997337c
Merge pull request #42 from xuchaoa/main
format code and fix wrong spell
2021-12-06 03:07:48 -06:00
xuc2
0bb3c92335 format code and fix wrong spell 2021-12-03 16:48:07 +08:00
link
7fd539c57e
Merge pull request #40 from IceWhaleTech/dev
update volume path
2021-12-01 20:49:48 -06:00
link
52bd22ab2b update volume path 2021-12-02 10:49:02 +08:00
John Guan
46e9458e82
Update demo.yml 2021-12-01 21:58:57 +08:00
John Guan
3f5595e794
Update demo.yml 2021-12-01 21:54:02 +08:00
John Guan
d22cc7d3f6
Update demo.yml 2021-12-01 21:49:23 +08:00
John Guan
eb03a3e6c7
Update demo.yml 2021-12-01 21:46:34 +08:00
John Guan
65cc1f4752
Update demo.yml 2021-12-01 21:36:44 +08:00
John Guan
99db197a39
Update demo.yml 2021-12-01 21:31:17 +08:00
John Guan
7e2a5d553c
Update demo.yml 2021-12-01 21:14:34 +08:00
John Guan
f02337b83b
Update demo.yml 2021-12-01 21:09:18 +08:00
John Guan
f66b67b0c9
Update demo.yml 2021-12-01 21:05:52 +08:00
John Guan
91087b5341
Update demo.yml 2021-12-01 21:01:40 +08:00
John Guan
c67191d8c2
Update demo.yml 2021-12-01 20:45:36 +08:00
John Guan
0fac461783
Update demo.yml 2021-12-01 20:11:32 +08:00
John Guan
ec5bc922e7
Update demo.yml 2021-12-01 20:07:44 +08:00
John Guan
7194792c3f
Update demo.yml 2021-12-01 19:51:36 +08:00
John Guan
76c8bade7f
Update demo.yml 2021-12-01 19:50:30 +08:00
John Guan
126857fab0
Create demo.yml 2021-12-01 19:43:50 +08:00
link
9ca57e105e
Merge pull request #38 from IceWhaleTech/dev
add uninstall.sh
2021-12-01 02:50:01 -06:00
link
2651140095 add uninstall.sh 2021-12-01 16:48:38 +08:00
link
14175bc438
Merge pull request #37 from IceWhaleTech/dev
fixed bug
2021-12-01 02:39:22 -06:00
link
956328da86 fixed bug 2021-12-01 16:25:56 +08:00
link
cc46a96a75
Merge pull request #27 from IceWhaleTech/v0.2.1
fixed path error
2021-11-25 05:44:33 -06:00
link
049090444e fixed path error 2021-11-25 19:41:25 +08:00
link
796c25b7a5
Merge pull request #26 from IceWhaleTech/v0.2.1
add sync function
2021-11-25 03:35:47 -06:00
link
9057290188 add sync function 2021-11-25 17:35:01 +08:00
John Guan
fcc57bb734 Update README.md 2021-11-24 18:35:14 +08:00
link
a98f5e087c
Merge pull request #24 from IceWhaleTech/add-license-1
Create LICENSE
2021-11-19 03:34:09 -06:00
link
403d563869
Create LICENSE 2021-11-19 17:33:57 +08:00
John Guan
88c15104b4 update README.md 2021-11-12 17:52:16 +08:00
link
6176289b88
Merge pull request #23 from IceWhaleTech/v0.2.1
update volumes
2021-11-10 03:51:14 -06:00
link
5cfd44da79 update volumes 2021-11-10 17:50:46 +08:00
link
2437da33a6
Merge pull request #21 from IceWhaleTech/v0.2.1
Update system.go
2021-11-09 05:11:58 -06:00
link
49ca0af746 Update system.go 2021-11-09 19:10:18 +08:00
link
9440b89fab
Merge pull request #20 from IceWhaleTech/v0.2.1
Fixing bugs
2021-11-09 04:58:59 -06:00
link
f020c1162d Fixing bugs
Resolve application installation path errors
2021-11-09 18:57:50 +08:00
link
120fb2cea2
Merge pull request #19 from IceWhaleTech/v0.2.1
update ui
2021-11-04 03:04:37 -05:00
link
37130966cf update ui 2021-11-04 16:03:33 +08:00
link
795b82c42c Update issue templates 2021-11-04 15:26:36 +08:00
link
57ad33d53a
Merge pull request #17 from IceWhaleTech/v0.2.1
update ui
2021-11-03 06:06:21 -05:00
link
a6ceee7bc0 update ui 2021-11-03 19:05:41 +08:00
link
44bb05fad0
Merge pull request #16 from IceWhaleTech/v0.2.1
New App Store
2021-11-03 04:08:45 -05:00
link
a5fee0ee97 New App Store
Add App Store for installation
Fix favicon display in dark mode
2021-11-03 17:07:46 +08:00
John Guan
da99b2d01a Update README.md 2021-11-03 10:51:32 +08:00
link
1433e3297b
Merge pull request #15 from IceWhaleTech/v0.2.1
Update UI
2021-10-29 06:36:37 -05:00
link
cad7af13af Update UI 2021-10-29 19:35:51 +08:00
link
39cb8904a3
Merge pull request #14 from IceWhaleTech/v0.2.1
V0.2.1
2021-10-29 05:39:54 -05:00
link
2ed372b3cd Update system.go 2021-10-29 18:39:07 +08:00
link
8bca76b78b Add new features
add casaOS logs
add application  terminal
add application  logs
2021-10-29 18:37:27 +08:00
link
595e0f28af
Merge pull request #13 from IceWhaleTech/v0.2.1
update disk display
2021-10-27 06:04:34 -05:00
link
4939fe10aa update disk display
add casaos logs api
update ui
2021-10-27 19:03:59 +08:00
link
d2962a8e70
Merge pull request #12 from IceWhaleTech/v0.2.1
Add some features
2021-10-27 04:29:44 -05:00
link
d7d53d639b Add some features
Add terminal
Improve single user management function
2021-10-27 17:27:46 +08:00
link
d2ff1b0506
Merge pull request #10 from IceWhaleTech/v0.2.1
update UI
2021-10-22 05:28:34 -05:00
link
7191735737 update UI 2021-10-22 18:28:00 +08:00
link
21f3fd85d9
Merge pull request #9 from IceWhaleTech/v0.2.1
update initialization config
2021-10-22 04:59:00 -05:00
link
ba77e07e36 update initialization config
initialization user config
2021-10-22 17:57:22 +08:00
link
0d6e7ca339
Merge pull request #8 from IceWhaleTech/v0.2.1
update route.go
2021-10-22 04:19:53 -05:00
link
b1d5d9858b update route.go 2021-10-22 17:19:07 +08:00
link
4f06be0e45
Merge pull request #7 from IceWhaleTech/v0.2.1
update webui
2021-10-22 04:10:24 -05:00
link
812ffd56a8 update webui 2021-10-22 17:09:43 +08:00
老竭力
6ba845eec5 Update issue templates 2021-10-22 16:58:29 +08:00
link
4fa72289ed
Merge pull request #6 from IceWhaleTech/v0.2.1
remove build file
2021-10-22 03:55:06 -05:00
link
5cdd842a3e remove build file
remove main
remove CasaOS
2021-10-22 16:54:17 +08:00
link
cc5504c0a9
Merge pull request #5 from IceWhaleTech/v0.2.1
Add authentication
2021-10-22 03:52:39 -05:00
link
b3aa22605d Add authentication
Add user authentication module, Login page and initialization page.
Fixed the problem that the application could not start after the system restarted.
2021-10-22 16:49:09 +08:00
John Guan
32e00b17b1 update README.md 2021-10-20 11:23:25 +08:00
John Guan
16108f03ac Merge branch 'main' of https://github.com/IceWhaleTech/CasaOS 2021-10-20 11:10:53 +08:00
John Guan
e7f990b224 Update README.md 2021-10-20 11:10:51 +08:00
link
c5d824c4ba
Merge pull request #3 from IceWhaleTech/v0.2.1
Optimize installation process
2021-10-19 06:12:40 -05:00
link
39ccbe251f Optimize installation process
auto create file or dir
2021-10-19 19:07:16 +08:00
link
e69d2e587b
Merge pull request #2 from IceWhaleTech/v0.2.1
update create file and dir api
2021-10-18 05:25:26 -05:00
link
8a28d3c589 update create file and dir api 2021-10-18 18:24:18 +08:00
link
8fe0e4aa73
Update casa.yml 2021-10-15 19:48:38 +08:00
link
30a23a93a2
Update casa.yml 2021-10-15 19:38:50 +08:00
link
53157fbb1f
Merge pull request #1 from IceWhaleTech/v0.2.1
add widget
2021-10-14 22:45:31 -05:00
link
fb15695dab add widget
Add CPU RAM Status
Add Disk Info
2021-10-15 11:43:41 +08:00
老竭力
5f5091f1e2 🦄 refactor: Change build method
Change build method
add static.go to public folder
2021-09-30 18:52:03 +08:00
a624669980
df92766c74 Catalog Adjustment 2021-09-30 18:45:01 +08:00
a624669980
cc8b3e8f06 Modify gitgnore 2021-09-30 18:42:29 +08:00
John Guan
a116db8dbd Update .gitignore 2021-09-30 18:40:16 +08:00
a624669980
d697547cb7 Modify default config 2021-09-30 17:55:59 +08:00
a624669980
01960c0391 Modify default config 2021-09-30 17:54:29 +08:00
a624669980
953c393e71 Modify default config 2021-09-30 17:53:26 +08:00
a624669980
0873f7dd46 Modify the publishing process 2021-09-30 17:00:55 +08:00
a624669980
8d93a7f320 Modify the publishing process 2021-09-30 16:57:10 +08:00
a624669980
801eca0a14 Modify the publishing process 2021-09-30 16:56:03 +08:00
a624669980
a3ec7b70c9 Modify the publishing process 2021-09-30 16:55:00 +08:00
282 changed files with 16430 additions and 17997 deletions

197
.all-contributorsrc Normal file
View File

@ -0,0 +1,197 @@
{
"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

@ -0,0 +1,26 @@
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!

64
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,64 @@
---
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.

14
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1,14 @@
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

@ -0,0 +1,20 @@
---
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.

19
.github/sync_openapi.yml vendored Normal file
View File

@ -0,0 +1,19 @@
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

@ -0,0 +1,33 @@
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

@ -40,7 +40,7 @@ jobs:
# env:
# GITHUB_TOKEN: ${{ github.token }}
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
@ -63,9 +63,9 @@ jobs:
# git clone $REPO_URL -b $REPO_BRANCH --recursive casa
# ln -sf /workdir/casa $GITHUB_WORKSPACE/casa
# ls
- name: Set enviroment for github-release
- 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
@ -73,43 +73,40 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '14'
# - name: Build frontend with nodejs and yarn
# run: |
# cd casa/UI
# ls
# yarn install
# yarn build
- 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: latest
# go_version: ${{ matrix.go_version }}
# dest: build
# prefix: casa
# targets: linux/amd64,linux/arm64
# v: true
# x: false
# race: false
# ldflags: -s -w
# buildmode: default
- name: List Files
run: |
ls
mkdir build
cd build
touch casa-linux-amd64
touch casa-linux-arm64
ls
echo "::set-output name=status::success"
- 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: |
@ -120,11 +117,7 @@ jobs:
- name: list work
run: ls
# - name: move
# run: |
# ls
# mv /workdir/casa/upload/linux-amd64-casaos.tar.gz ./linux-amd64-casaos.tar.gz
# mv /workdir/casa/upload/linux-arm64-casaos.tar.gz ./linux-arm64-casaos.tar.gz
- name: Update release
uses: meeDamian/github-release@2.0
with:
@ -132,6 +125,7 @@ jobs:
files: >
linux-amd64-casaos.tar.gz
linux-arm64-casaos.tar.gz
linux-arm-7-casaos.tar.gz
tag: v${{ env.VERSION }}
body: >
${{ env.BODY }}

28
.github/workflows/codecov.yml vendored Normal file
View File

@ -0,0 +1,28 @@
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

84
.github/workflows/demo.yml vendored Normal file
View File

@ -0,0 +1,84 @@
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

@ -0,0 +1,27 @@
# 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

46
.github/workflows/publish_npm.yaml vendored Normal file
View File

@ -0,0 +1,46 @@
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

@ -0,0 +1,42 @@
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 }}

92
.github/workflows/push_test_server.yml vendored Normal file
View File

@ -0,0 +1,92 @@
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 }}

25
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,25 @@
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 }}

19
.github/workflows/sync_openapi.yml vendored Normal file
View File

@ -0,0 +1,19 @@
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 }}

16
.gitignore vendored
View File

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

194
.goreleaser.debug.yaml Normal file
View File

@ -0,0 +1,194 @@
# 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 }}"

252
.goreleaser.yaml Normal file
View File

@ -0,0 +1,252 @@
# 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 }}"

616
CHANGELOG.md Normal file
View File

@ -0,0 +1,616 @@
# 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

128
CODE_OF_CONDUCT.md Normal file
View File

@ -0,0 +1,128 @@
# 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.

33
DEVELOPING.md Normal file
View File

@ -0,0 +1,33 @@
# 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 Normal file
View File

@ -0,0 +1,201 @@
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.

293
README.md
View File

@ -1,86 +1,257 @@
# CasaOS - A simple, easy-to-use, elegant open-source home server system.
# CasaOS - Your Personal Cloud
<!-- Readme i18n links -->
<!-- > English | [中文](#) | [Français](#) -->
![CasaOS](https://raw.githubusercontent.com/IceWhaleTech/logo/main/casaos/casaos_banner_aldeyjarfoss.png)
<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>
[![Version](https://img.shields.io/github/v/release/IceWhaleTech/CasaOS?color=162453&label=CasaOS&style=flat-square)](https://github.com/IceWhaleTech/CasaOS)
[![Pull Requests](https://img.shields.io/github/issues-pr/IceWhaleTech/CasaOS?color=162453&style=flat-square)](https://github.com/IceWhaleTech/CasaOS/pulls)
[![Issues](https://img.shields.io/github/issues/IceWhaleTech/CasaOS?color=162453&style=flat-square)](https://github.com/IceWhaleTech/CasaOS/issues)
[![GitHub Stars](https://img.shields.io/github/stars/IceWhaleTech/CasaOS?color=162453&logo=github&style=flat-square)](https://github.com/IceWhaleTech/CasaOS/stargazers)
[![Discord](https://img.shields.io/discord/884667213326463016?color=162453&label=Chat&logo=discord&logoColor=fff&style=flat-square)](https://discord.gg/Gx4BCEtHjx)
## Why do you need Personal Cloud?
CasaOS is an open-source home server system based on the Docker ecosystem and designed for home scenarios. It is committed to building the world's most simple, easy-to-use, and elegant home server system.
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.
IceWhale team believes that through community-driven collaborative innovation and open communication with global developers, we can reshape the digital home experience like never before.
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.
## Key Features
> If you think what we are doing is valuable. Please **give us a star ⭐** and **fork it 🤞**!
- UI designed for home scenarios - simple, elegant, and easy-to-use
- Quick Docker app installation with only three steps, plus automatic management
- App Store for private cloud 🚧
- Home data/digital asset management 🚧
- Smart home manager 🚧
🚧 is under development.
We are actively moving forward with development, and you are more than welcome to share any idea with us!
## Community
The word Casa comes from the Spanish word for "home". Project CasaOS originated as a pre-installed system for 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.
> A warm welcome for you to share and discuss your great ideas in the [Discord server](https://discord.gg/Gx4BCEtHjx)!
[![Discord Card](https://discordapp.com/api/guilds/884667213326463016/widget.png?style=banner2)](https://discord.gg/Gx4BCEtHjx)
## 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
> ⚠️ Note:
>
> CasaOS is still in the early development stage and may vary significantly with the final release. Feel free to test run and share your feedback in the [Discord server](https://discord.gg/Gx4BCEtHjx)!
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
- Ubuntu Server 20.04 amd64 (✅ Recommend, Tested)
- Debian 11 amd64 (⚠️ Not Fully Tested Yet)
- OpenWrt 21.02 amd64 (⚠️ Not Fully Tested Yet)
- Raspberry Pi OS aarch64/arm64 (🚧 Under Planning)
- OpenWrt 21.02 aarch64/arm64 (🚧 Under Planning)
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
Fresh install a system from the above list and run the below command:
Freshly install a system from the list above and run this command:
```sh
curl -fsSL https://get.icewhale.io/casaos.sh | bash
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
```
## To Do
**v 0.1.x**
- [x] An elegant UI for home scenarios
- [x] Custom installation of Docker Apps
- [x] Update, stop, uninstall, restart, etc. of Docker apps
- [x] Docker CLI parser
- [x] System Update
- [ ] Getting Started tutorial
- [ ] Docker Compose parser
- [ ] App config file import and export
- [ ] macvlan network mode
### Uninstall CasaOS
## Maintainers
- Jerry Liu
- Link Liang
- Ober Zhang
- Zyaire Ann
- John Guan
- Right here, waiting for YOU!
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>

9
SECURITY.md Normal file
View File

@ -0,0 +1,9 @@
# 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

1
UI

@ -1 +0,0 @@
Subproject commit c75085250a164de1a48bcdfb108812fb9a8bf44a

359
api/casaos/openapi.yaml Normal file
View File

@ -0,0 +1,359 @@
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"

24
api/index.html Normal file
View File

@ -0,0 +1,24 @@
<!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

@ -0,0 +1,197 @@
#!/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

@ -0,0 +1,3 @@
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

@ -0,0 +1,56 @@
#!/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

@ -0,0 +1,40 @@
#!/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

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

View File

@ -0,0 +1,40 @@
#!/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

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

View File

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

View File

@ -0,0 +1,22 @@
[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

@ -0,0 +1,13 @@
[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

@ -0,0 +1,12 @@
[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

View File

@ -0,0 +1,58 @@
#!/bin/bash
###
# @Author: LinkLeong link@icewhale.org
# @Date: 2022-11-15 15:51:44
# @LastEditors: LinkLeong
# @LastEditTime: 2022-11-15 15:53:37
# @FilePath: /CasaOS/build/sysroot/usr/share/casaos/cleanup/script.d/03-cleanup-casaos.sh
# @Description:
# @Website: https://www.casaos.io
# Copyright (c) 2022 by icewhale, All Rights Reserved.
###
set -e
readonly 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)
readonly SETUP_SCRIPT_DIRECTORY
readonly SETUP_SCRIPT_FILENAME="cleanup-${APP_NAME_SHORT}.sh"
readonly SETUP_SCRIPT_FILEPATH="${SETUP_SCRIPT_DIRECTORY}/${SETUP_SCRIPT_FILENAME}"
echo "🟩 Running ${SETUP_SCRIPT_FILENAME}..."
$SHELL "${SETUP_SCRIPT_FILEPATH}" "${BUILD_PATH}"

View File

@ -0,0 +1,204 @@
#!/bin/bash
set -e
readonly CASA_SERVICES=(
"casaos.service"
"devmon@devmon.service"
)
readonly CASA_EXEC=casaos
readonly CASA_CONF=/etc/casaos/casaos.conf
readonly CASA_URL=/var/run/casaos/casaos.url
readonly CASA_SERVICE_USR=/usr/lib/systemd/system/casaos.service
readonly CASA_SERVICE_LIB=/lib/systemd/system/casaos.service
readonly CASA_SERVICE_ETC=/etc/systemd/system/casaos.service
# Old Casa Files
readonly CASA_PATH=/casaOS
readonly CASA_CONF_PATH_OLD=/etc/casaos.conf
readonly aCOLOUR=(
'\e[38;5;154m' # green | Lines, bullets and separators
'\e[1m' # Bold white | Main descriptions
'\e[90m' # Grey | Credits
'\e[91m' # Red | Update notifications Alert
'\e[33m' # Yellow | Emphasis
)
Show() {
# OK
if (($1 == 0)); then
echo -e "${aCOLOUR[2]}[$COLOUR_RESET${aCOLOUR[0]} OK $COLOUR_RESET${aCOLOUR[2]}]$COLOUR_RESET $2"
# FAILED
elif (($1 == 1)); then
echo -e "${aCOLOUR[2]}[$COLOUR_RESET${aCOLOUR[3]}FAILED$COLOUR_RESET${aCOLOUR[2]}]$COLOUR_RESET $2"
# INFO
elif (($1 == 2)); then
echo -e "${aCOLOUR[2]}[$COLOUR_RESET${aCOLOUR[0]} INFO $COLOUR_RESET${aCOLOUR[2]}]$COLOUR_RESET $2"
# NOTICE
elif (($1 == 3)); then
echo -e "${aCOLOUR[2]}[$COLOUR_RESET${aCOLOUR[4]}NOTICE$COLOUR_RESET${aCOLOUR[2]}]$COLOUR_RESET $2"
fi
}
Warn() {
echo -e "${aCOLOUR[3]}$1$COLOUR_RESET"
}
trap 'onCtrlC' INT
onCtrlC() {
echo -e "${COLOUR_RESET}"
exit 1
}
Detecting_CasaOS() {
if [[ ! -x "$(command -v ${CASA_EXEC})" ]]; then
Show 2 "CasaOS is not detected, exit the script."
exit 1
else
Show 0 "This script will delete the containers you no longer use, and the CasaOS configuration files."
fi
}
Uninstall_Container() {
if [[ ${UNINSTALL_ALL_CONTAINER} == true && "$(docker ps -aq)" != "" ]]; then
Show 2 "Start deleting containers."
docker stop "$(docker ps -aq)" || Show 1 "Failed to stop all containers."
docker rm "$(docker ps -aq)" || Show 1 "Failed to delete all containers."
fi
}
Remove_Images() {
if [[ ${REMOVE_IMAGES} == "all" && "$(docker images -q)" != "" ]]; then
Show 2 "Start deleting all images."
docker rmi "$(docker images -q)" || Show 1 "Failed to delete all images."
elif [[ ${REMOVE_IMAGES} == "unuse" && "$(docker images -q)" != "" ]]; then
Show 2 "Start deleting unuse images."
docker image prune -af || Show 1 "Failed to delete unuse images."
fi
}
Uninstall_Casaos() {
for SERVICE in "${CASA_SERVICES[@]}"; do
Show 2 "Stopping ${SERVICE}..."
systemctl disable --now "${SERVICE}" || Show 3 "Failed to disable ${SERVICE}"
done
# Remove Service file
if [[ -f ${CASA_SERVICE_USR} ]]; then
rm -rvf ${CASA_SERVICE_USR}
fi
if [[ -f ${CASA_SERVICE_LIB} ]]; then
rm -rvf ${CASA_SERVICE_LIB}
fi
if [[ -f ${CASA_SERVICE_ETC} ]]; then
rm -rvf ${CASA_SERVICE_ETC}
fi
# Old Casa Files
if [[ -d ${CASA_PATH} ]]; then
rm -rvf ${CASA_PATH} || Show 1 "Failed to delete legacy CasaOS files."
fi
if [[ -f ${CASA_CONF_PATH_OLD} ]]; then
rm -rvf ${CASA_CONF_PATH_OLD}
fi
# New Casa Files
if [[ ${REMOVE_APP_DATA} = true ]]; then
rm -rvf /DATA/AppData || Show 1 "Failed to delete AppData."
fi
rm -rvf "$(which ${CASA_EXEC})" || Show 3 "Failed to remove ${CASA_EXEC}"
rm -rvf ${CASA_CONF} || Show 3 "Failed to remove ${CASA_CONF}"
rm -rvf ${CASA_URL} || Show 3 "Failed to remove ${CASA_URL}"
rm -rvf /var/lib/casaos/app_category.json
rm -rvf /var/lib/casaos/app_list.json
rm -rvf /var/lib/casaos/docker_root
}
Detecting_CasaOS
while true; do
echo -n -e " ${aCOLOUR[4]}Do you want delete all containers? Y/n :${COLOUR_RESET}"
read -r input
case $input in
[yY][eE][sS] | [yY])
UNINSTALL_ALL_CONTAINER=true
break
;;
[nN][oO] | [nN])
UNINSTALL_ALL_CONTAINER=false
break
;;
*)
Warn " Invalid input..."
;;
esac
done
if [[ ${UNINSTALL_ALL_CONTAINER} == true ]]; then
while true; do
echo -n -e " ${aCOLOUR[4]}Do you want delete all images? Y/n :${COLOUR_RESET}"
read -r input
case $input in
[yY][eE][sS] | [yY])
REMOVE_IMAGES="all"
break
;;
[nN][oO] | [nN])
REMOVE_IMAGES="none"
break
;;
*)
Warn " Invalid input..."
;;
esac
done
while true; do
echo -n -e " ${aCOLOUR[4]}Do you want delete all AppData of CasaOS? Y/n :${COLOUR_RESET}"
read -r input
case $input in
[yY][eE][sS] | [yY])
REMOVE_APP_DATA=true
break
;;
[nN][oO] | [nN])
REMOVE_APP_DATA=false
break
;;
*)
Warn " Invalid input..."
;;
esac
done
else
while true; do
echo -n -e " ${aCOLOUR[4]}Do you want to delete all images that are not used by the container? Y/n :${COLOUR_RESET}"
read -r input
case $input in
[yY][eE][sS] | [yY])
REMOVE_IMAGES="unuse"
break
;;
[nN][oO] | [nN])
REMOVE_IMAGES="none"
break
;;
*)
Warn " Invalid input..."
;;
esac
done
fi
Uninstall_Container
Remove_Images
Uninstall_Casaos

View File

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

View File

@ -0,0 +1,204 @@
#!/bin/bash
set -e
readonly CASA_SERVICES=(
"casaos.service"
"devmon@devmon.service"
)
readonly CASA_EXEC=casaos
readonly CASA_CONF=/etc/casaos/casaos.conf
readonly CASA_URL=/var/run/casaos/casaos.url
readonly CASA_SERVICE_USR=/usr/lib/systemd/system/casaos.service
readonly CASA_SERVICE_LIB=/lib/systemd/system/casaos.service
readonly CASA_SERVICE_ETC=/etc/systemd/system/casaos.service
# Old Casa Files
readonly CASA_PATH=/casaOS
readonly CASA_CONF_PATH_OLD=/etc/casaos.conf
readonly aCOLOUR=(
'\e[38;5;154m' # green | Lines, bullets and separators
'\e[1m' # Bold white | Main descriptions
'\e[90m' # Grey | Credits
'\e[91m' # Red | Update notifications Alert
'\e[33m' # Yellow | Emphasis
)
Show() {
# OK
if (($1 == 0)); then
echo -e "${aCOLOUR[2]}[$COLOUR_RESET${aCOLOUR[0]} OK $COLOUR_RESET${aCOLOUR[2]}]$COLOUR_RESET $2"
# FAILED
elif (($1 == 1)); then
echo -e "${aCOLOUR[2]}[$COLOUR_RESET${aCOLOUR[3]}FAILED$COLOUR_RESET${aCOLOUR[2]}]$COLOUR_RESET $2"
# INFO
elif (($1 == 2)); then
echo -e "${aCOLOUR[2]}[$COLOUR_RESET${aCOLOUR[0]} INFO $COLOUR_RESET${aCOLOUR[2]}]$COLOUR_RESET $2"
# NOTICE
elif (($1 == 3)); then
echo -e "${aCOLOUR[2]}[$COLOUR_RESET${aCOLOUR[4]}NOTICE$COLOUR_RESET${aCOLOUR[2]}]$COLOUR_RESET $2"
fi
}
Warn() {
echo -e "${aCOLOUR[3]}$1$COLOUR_RESET"
}
trap 'onCtrlC' INT
onCtrlC() {
echo -e "${COLOUR_RESET}"
exit 1
}
Detecting_CasaOS() {
if [[ ! -x "$(command -v ${CASA_EXEC})" ]]; then
Show 2 "CasaOS is not detected, exit the script."
exit 1
else
Show 0 "This script will delete the containers you no longer use, and the CasaOS configuration files."
fi
}
Uninstall_Container() {
if [[ ${UNINSTALL_ALL_CONTAINER} == true && "$(docker ps -aq)" != "" ]]; then
Show 2 "Start deleting containers."
docker stop "$(docker ps -aq)" || Show 1 "Failed to stop all containers."
docker rm "$(docker ps -aq)" || Show 1 "Failed to delete all containers."
fi
}
Remove_Images() {
if [[ ${REMOVE_IMAGES} == "all" && "$(docker images -q)" != "" ]]; then
Show 2 "Start deleting all images."
docker rmi "$(docker images -q)" || Show 1 "Failed to delete all images."
elif [[ ${REMOVE_IMAGES} == "unuse" && "$(docker images -q)" != "" ]]; then
Show 2 "Start deleting unuse images."
docker image prune -af || Show 1 "Failed to delete unuse images."
fi
}
Uninstall_Casaos() {
for SERVICE in "${CASA_SERVICES[@]}"; do
Show 2 "Stopping ${SERVICE}..."
systemctl disable --now "${SERVICE}" || Show 3 "Failed to disable ${SERVICE}"
done
# Remove Service file
if [[ -f ${CASA_SERVICE_USR} ]]; then
rm -rvf ${CASA_SERVICE_USR}
fi
if [[ -f ${CASA_SERVICE_LIB} ]]; then
rm -rvf ${CASA_SERVICE_LIB}
fi
if [[ -f ${CASA_SERVICE_ETC} ]]; then
rm -rvf ${CASA_SERVICE_ETC}
fi
# Old Casa Files
if [[ -d ${CASA_PATH} ]]; then
rm -rvf ${CASA_PATH} || Show 1 "Failed to delete legacy CasaOS files."
fi
if [[ -f ${CASA_CONF_PATH_OLD} ]]; then
rm -rvf ${CASA_CONF_PATH_OLD}
fi
# New Casa Files
if [[ ${REMOVE_APP_DATA} = true ]]; then
rm -rvf /DATA/AppData || Show 1 "Failed to delete AppData."
fi
rm -rvf "$(which ${CASA_EXEC})" || Show 3 "Failed to remove ${CASA_EXEC}"
rm -rvf ${CASA_CONF} || Show 3 "Failed to remove ${CASA_CONF}"
rm -rvf ${CASA_URL} || Show 3 "Failed to remove ${CASA_URL}"
rm -rvf /var/lib/casaos/app_category.json
rm -rvf /var/lib/casaos/app_list.json
rm -rvf /var/lib/casaos/docker_root
}
Detecting_CasaOS
while true; do
echo -n -e " ${aCOLOUR[4]}Do you want delete all containers? Y/n :${COLOUR_RESET}"
read -r input
case $input in
[yY][eE][sS] | [yY])
UNINSTALL_ALL_CONTAINER=true
break
;;
[nN][oO] | [nN])
UNINSTALL_ALL_CONTAINER=false
break
;;
*)
Warn " Invalid input..."
;;
esac
done
if [[ ${UNINSTALL_ALL_CONTAINER} == true ]]; then
while true; do
echo -n -e " ${aCOLOUR[4]}Do you want delete all images? Y/n :${COLOUR_RESET}"
read -r input
case $input in
[yY][eE][sS] | [yY])
REMOVE_IMAGES="all"
break
;;
[nN][oO] | [nN])
REMOVE_IMAGES="none"
break
;;
*)
Warn " Invalid input..."
;;
esac
done
while true; do
echo -n -e " ${aCOLOUR[4]}Do you want delete all AppData of CasaOS? Y/n :${COLOUR_RESET}"
read -r input
case $input in
[yY][eE][sS] | [yY])
REMOVE_APP_DATA=true
break
;;
[nN][oO] | [nN])
REMOVE_APP_DATA=false
break
;;
*)
Warn " Invalid input..."
;;
esac
done
else
while true; do
echo -n -e " ${aCOLOUR[4]}Do you want to delete all images that are not used by the container? Y/n :${COLOUR_RESET}"
read -r input
case $input in
[yY][eE][sS] | [yY])
REMOVE_IMAGES="unuse"
break
;;
[nN][oO] | [nN])
REMOVE_IMAGES="none"
break
;;
*)
Warn " Invalid input..."
;;
esac
done
fi
Uninstall_Container
Remove_Images
Uninstall_Casaos

View File

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

View File

@ -0,0 +1 @@
../../debian/bullseye/cleanup-casaos.sh

View File

@ -0,0 +1,3 @@
#!/bin/bash

View File

@ -0,0 +1,105 @@
#!/bin/bash
###
# @Author: LinkLeong link@icewhale.com
# @Date: 2022-06-30 10:08:33
# @LastEditors: LinkLeong
# @LastEditTime: 2022-07-01 11:17:54
# @FilePath: /CasaOS/shell/delete-old-service.sh
# @Description:
###
((EUID)) && sudo_cmd="sudo"
# SYSTEM INFO
readonly UNAME_M="$(uname -m)"
# CasaOS PATHS
readonly CASA_REPO=IceWhaleTech/CasaOS
readonly CASA_UNZIP_TEMP_FOLDER=/tmp/casaos
readonly CASA_BIN=casaos
readonly CASA_BIN_PATH=/usr/bin/casaos
readonly CASA_CONF_PATH=/etc/casaos.conf
readonly CASA_SERVICE_PATH=/etc/systemd/system/casaos.service
readonly CASA_HELPER_PATH=/usr/share/casaos/shell/
readonly CASA_USER_CONF_PATH=/var/lib/casaos/conf/
readonly CASA_DB_PATH=/var/lib/casaos/db/
readonly CASA_TEMP_PATH=/var/lib/casaos/temp/
readonly CASA_LOGS_PATH=/var/log/casaos/
readonly CASA_PACKAGE_EXT=".tar.gz"
readonly CASA_RELEASE_API="https://api.github.com/repos/${CASA_REPO}/releases"
readonly CASA_OPENWRT_DOCS="https://github.com/IceWhaleTech/CasaOS-OpenWrt"
readonly COLOUR_RESET='\e[0m'
readonly aCOLOUR=(
'\e[38;5;154m' # green | Lines, bullets and separators
'\e[1m' # Bold white | Main descriptions
'\e[90m' # Grey | Credits
'\e[91m' # Red | Update notifications Alert
'\e[33m' # Yellow | Emphasis
)
Target_Arch=""
Target_Distro="debian"
Target_OS="linux"
Casa_Tag=""
#######################################
# Custom printing function
# Globals:
# None
# Arguments:
# $1 0:OK 1:FAILED 2:INFO 3:NOTICE
# message
# Returns:
# None
#######################################
Show() {
# OK
if (($1 == 0)); then
echo -e "${aCOLOUR[2]}[$COLOUR_RESET${aCOLOUR[0]} OK $COLOUR_RESET${aCOLOUR[2]}]$COLOUR_RESET $2"
# FAILED
elif (($1 == 1)); then
echo -e "${aCOLOUR[2]}[$COLOUR_RESET${aCOLOUR[3]}FAILED$COLOUR_RESET${aCOLOUR[2]}]$COLOUR_RESET $2"
# INFO
elif (($1 == 2)); then
echo -e "${aCOLOUR[2]}[$COLOUR_RESET${aCOLOUR[0]} INFO $COLOUR_RESET${aCOLOUR[2]}]$COLOUR_RESET $2"
# NOTICE
elif (($1 == 3)); then
echo -e "${aCOLOUR[2]}[$COLOUR_RESET${aCOLOUR[4]}NOTICE$COLOUR_RESET${aCOLOUR[2]}]$COLOUR_RESET $2"
fi
}
Warn() {
echo -e "${aCOLOUR[3]}$1$COLOUR_RESET"
}
# 0 Check_exist
Check_Exist() {
#Create Dir
Show 2 "Create Folders."
${sudo_cmd} mkdir -p ${CASA_HELPER_PATH}
${sudo_cmd} mkdir -p ${CASA_LOGS_PATH}
${sudo_cmd} mkdir -p ${CASA_USER_CONF_PATH}
${sudo_cmd} mkdir -p ${CASA_DB_PATH}
${sudo_cmd} mkdir -p ${CASA_TEMP_PATH}
Show 2 "Start cleaning up the old version."
${sudo_cmd} rm -rf /usr/lib/systemd/system/casaos.service
${sudo_cmd} rm -rf /lib/systemd/system/casaos.service
${sudo_cmd} rm -rf /usr/local/bin/${CASA_BIN}
#Clean
if [[ -d "/casaOS" ]]; then
${sudo_cmd} rm -rf /casaOS
fi
Show 0 "Clearance completed."
$sudo_cmd systemctl restart ${CASA_BIN}
}
Check_Exist

View File

@ -0,0 +1,359 @@
#!/bin/bash
# 获取系统信息
GetSysInfo() {
if [ -s "/etc/redhat-release" ]; then
SYS_VERSION=$(cat /etc/redhat-release)
elif [ -s "/etc/issue" ]; then
SYS_VERSION=$(cat /etc/issue)
fi
SYS_INFO=$(uname -a)
SYS_BIT=$(getconf LONG_BIT)
MEM_TOTAL=$(free -m | grep Mem | awk '{print $2}')
CPU_INFO=$(getconf _NPROCESSORS_ONLN)
echo -e ${SYS_VERSION}
echo -e Bit:${SYS_BIT} Mem:${MEM_TOTAL}M Core:${CPU_INFO}
echo -e ${SYS_INFO}
}
#获取网卡信息
GetNetCard() {
if [ "$1" == "1" ]; then
if [ -d "/sys/devices/virtual/net" ]; then
ls /sys/devices/virtual/net
fi
else
if [ -d "/sys/devices/virtual/net" ] && [ -d "/sys/class/net" ]; then
ls /sys/class/net/ | grep -v "$(ls /sys/devices/virtual/net/)" -w
fi
fi
}
GetTimeZone(){
timedatectl | grep "Time zone" | awk '{printf $3}'
}
#查看网卡状态
#param 网卡名称
CatNetCardState() {
if [ -e "/sys/class/net/$1/operstate" ]; then
cat /sys/class/net/$1/operstate
fi
}
#获取docker根目录
GetDockerRootDir() {
if hash docker 2>/dev/null; then
docker info | grep 'Docker Root Dir' | awk -F ':' '{print $2}'
else
echo ""
fi
}
#删除安装应用文件夹
#param 需要删除的文件夹路径
DelAppConfigDir() {
if [ -d $1 ]; then
rm -fr $1
fi
}
#zerotier本机已加入的网络
#result start,end,sectors
GetLocalJoinNetworks() {
zerotier-cli listnetworks -j
}
#格式化fat32磁盘
#param 需要格式化的目录 /dev/sda1
#param 格式
FormatDisk() {
if [ "$2" == "fat32" ]; then
mkfs.vfat -F 32 $1
elif [ "$2" == "ntfs" ]; then
mkfs.ntfs $1
elif [ "$2" == "ext4" ]; then
mkfs.ext4 -m 1 -F $1
elif [ "$2" == "exfat" ]; then
mkfs.exfat $1
else
mkfs.ext4 -m 1 -F $1
fi
}
#删除分区
#param 路径 /dev/sdb
#param 删除分区的区号
DelPartition() {
fdisk $1 <<EOF
d
$2
wq
EOF
}
#添加分区只有一个分区
#param 路径 /dev/sdb
#param 要挂载的目录
AddPartition() {
DelPartition $1
parted -s $1 mklabel gpt
parted -s $1 mkpart primary ext4 0 100%
P=`lsblk -r $1 | sort | grep part | head -n 1 | awk '{print $1}'`
mkfs.ext4 -m 1 -F /dev/${P}
partprobe $1
}
#磁盘类型
GetDiskType() {
fdisk $1 -l | grep Disklabel | awk -F: '{print $2}'
}
#获磁盘的插入路径
#param 路径 /dev/sda
GetPlugInDisk() {
fdisk -l | grep 'Disk' | grep 'sd' | awk -F , '{print substr($1,11,3)}'
}
#获取磁盘字节数量和扇区数量
#param 磁盘路径 /dev/sda
#result bytes
#result sectors
GetDiskSizeAndSectors() {
fdisk $1 -l | grep "$1:" | awk -F, 'BEGIN {OFS="\n"}{print $2,$3}' | awk '{print $1}'
}
#获取磁盘分区数据扇区
#param 磁盘路径 /dev/sda
#result start,end,sectors
GetPartitionSectors() {
fdisk $1 -l | grep "$1[1-9]" | awk 'BEGIN{OFS=","}{print $1,$2,$3,$4}'
}
#检查没有使用的挂载点删除文件夹
AutoRemoveUnuseDir() {
DIRECTORY="/DATA/"
dir=$(ls -l $DIRECTORY | grep "USB_Storage_sd[a-z][0-9]" | awk '/^d/ {print $NF}')
for i in $dir; do
path="$DIRECTORY$i"
mountStr=$(mountpoint $path)
notMountpoint="is not a mountpoint"
if [[ $mountStr =~ $notMountpoint ]]; then
if [ "$(ls -A $path)" = "" ]; then
rm -fr $path
else
echo "$path is not empty"
fi
fi
done
}
#重载samba服务
ReloadSamba() {
/etc/init.d/smbd reload
}
# $1=sda1
# $2=volume{1}
do_mount() {
DEVBASE=$1
DEVICE="${DEVBASE}"
# See if this drive is already mounted, and if so where
MOUNT_POINT=$(lsblk -o name,mountpoint | grep ${DEVICE} | awk '{print $2}')
if [ -n "${MOUNT_POINT}" ]; then
${log} "Warning: ${DEVICE} is already mounted at ${MOUNT_POINT}"
exit 1
fi
# Get info for this drive: $ID_FS_LABEL and $ID_FS_TYPE
eval $(blkid -o udev ${DEVICE} | grep -i -e "ID_FS_LABEL" -e "ID_FS_TYPE")
LABEL=$2
if grep -q " ${LABEL} " /etc/mtab; then
# Already in use, make a unique one
LABEL+="-${DEVBASE}"
fi
DEV_LABEL="${LABEL}"
# Use the device name in case the drive doesn't have label
if [ -z ${DEV_LABEL} ]; then
DEV_LABEL="${DEVBASE}"
fi
MOUNT_POINT="${DEV_LABEL}"
${log} "Mount point: ${MOUNT_POINT}"
mkdir -p ${MOUNT_POINT}
case ${ID_FS_TYPE} in
vfat)
mount -t vfat -o rw,relatime,users,gid=100,umask=000,shortname=mixed,utf8=1,flush ${DEVICE} ${MOUNT_POINT}
;;
ext[2-4])
mount -o noatime ${DEVICE} ${MOUNT_POINT} >/dev/null 2>&1
;;
exfat)
mount -t exfat ${DEVICE} ${MOUNT_POINT} >/dev/null 2>&1
;;
ntfs)
ntfs-3g ${DEVICE} ${MOUNT_POINT}
;;
iso9660)
mount -t iso9660 ${DEVICE} ${MOUNT_POINT}
;;
*)
/bin/rmdir "${MOUNT_POINT}"
exit 0
;;
esac
}
# $1=sda1
do_umount() {
log="logger -t usb-mount.sh -s "
DEVBASE=$1
DEVICE="${DEVBASE}"
MOUNT_POINT=$(mount | grep ${DEVICE} | awk '{ print $3 }')
if [[ -z ${MOUNT_POINT} ]]; then
${log} "Warning: ${DEVICE} is not mounted"
else
/bin/kill -9 $(lsof ${MOUNT_POINT})
umount -l ${DEVICE}
${log} "Unmounted ${DEVICE} from ${MOUNT_POINT}"
if [ "`ls -A ${MOUNT_POINT}`" = "" ]; then
/bin/rm -fr "${MOUNT_POINT}"
fi
sed -i.bak "\@${MOUNT_POINT}@d" /var/log/usb-mount.track
fi
}
# $1=/mnt/volume1/data.img
# $2=100G
PackageDocker() {
image=$1
docker="/mnt/casa_docker"
#判断目录docker存在不存在则创建,存在检查是否为空
if [ ! -d "$docker" ]; then
mkdir ${docker}
fi
if [ "$(ls -A $docker)" = "" ]; then
echo "$docker count is 0"
else
mkdir ${docker}_bak
mv -r ${docker} ${docker}_bak
fi
daemon="/etc/docker/daemon.json"
#1创建img文件在挂载的目录
fallocate -l $2 $image
#2初始化img文件
mkfs -t ext4 $image
#3挂载img文件
sudo mount -o loop $image $docker
#4给移动/var/lib/docker数据到img挂载的目录
systemctl stop docker.socket
systemctl stop docker
cp -r /var/lib/docker/* ${docker}/
#5在/etc/docker写入daemon.json(需要检查)
if [ -d "$daemon" ]; then
mv -r $daemon ${daemon}.bak
fi
echo "{\"data-root\": \"$docker\"}" >$daemon
#删除老数据腾出空间
#rm -fr /var/lib/docker
systemctl start docker.socket
systemctl start docker
}
DockerImgMove() {
image=$1
systemctl stop docker.socket
systemctl stop docker
sudo umount -f $image
}
GetDockerDataRoot() {
docker info | grep "Docker Root Dir:"
}
SetLink() {
ln -s /mnt/casa_sda1/AppData /DATA/AppData
#删除所有软链
find /DATA -type l -delete
}
#压缩文件夹
TarFolder() {
#压缩
tar -zcvf data.tar.gz -C/DATA/ AppDataBak/
#解压
tar zxvf data.tar.gz
#查看某文件夹下的所有包括子文件夹文件
ls /DATA/Media -lR | grep "^-" | wc -l
# ls -lR|grep "^d"| wc -l 查看某个文件夹下文件夹的个数,包括子文件夹下的文件夹个数。
#查看固定文件夹大小
du -sh /DATA
}
USB_Start_Auto() {
((EUID)) && sudo_cmd="sudo"
$sudo_cmd systemctl enable devmon@devmon
$sudo_cmd systemctl start devmon@devmon
}
USB_Stop_Auto() {
((EUID)) && sudo_cmd="sudo"
$sudo_cmd systemctl stop devmon@devmon
$sudo_cmd systemctl disable devmon@devmon
$sudo_cmd udevil clean
}
GetDeviceTree(){
cat /proc/device-tree/model
}
# restart samba service
RestartSMBD(){
$sudo_cmd systemctl restart smbd
}
# edit user password $1:username
EditSmabaUserPassword(){
$sudo_cmd smbpasswd $1
}
AddSmabaUser(){
$sudo_cmd useradd $1
$sudo_cmd smbpasswd -a $1 <<EOF
$2
$2
EOF
}
# $1:username $2:host $3:share $4:port $5:mountpoint $6:password
MountCIFS(){
$sudo_cmd mount -t cifs -o username=$1,password=$6,port=$4 //$2/$3 $5
}
UDEVILUmount(){
$sudo_cmd udevil umount -f $1
}

View File

@ -0,0 +1,12 @@
#!/bin/bash
###
# @Author: LinkLeong link@icewhale.com
# @Date: 2022-06-30 10:08:33
# @LastEditors: LinkLeong
# @LastEditTime: 2022-09-01 22:33:06
# @FilePath: /CasaOS/build/sysroot/usr/share/casaos/shell/update.sh
# @Description:
###
curl -fsSL https://raw.githubusercontent.com/IceWhaleTech/get/main/update.sh | bash

View File

@ -1,12 +1,10 @@
#!/bin/sh
#!/bin/bash
# copy to /oasis/util/shell path
# copy to /casaOS/util/shell path
# chmod 755
log="logger -t usb-mount.sh -s "
${log} "变量:$1 $2"
ACTION=$1
DEVBASE=$2
@ -14,14 +12,14 @@ DEVBASE=$2
DEVICE="/dev/${DEVBASE}"
# See if this drive is already mounted, and if so where
MOUNT_POINT=$(mount | grep ${DEVICE} | awk '{ print $3 }')
MOUNT_POINT=$(lsblk -l -p -o name,mountpoint | grep ${DEVICE} | awk '{print $2}')
do_mount() {
if [[ -n ${MOUNT_POINT} ]]; then
if [ -n "${MOUNT_POINT}" ]; then
${log} "Warning: ${DEVICE} is already mounted at ${MOUNT_POINT}"
exit 1
fib
fi
# Get info for this drive: $ID_FS_LABEL and $ID_FS_TYPE
eval $(blkid -o udev ${DEVICE} | grep -i -e "ID_FS_LABEL" -e "ID_FS_TYPE")
@ -33,9 +31,9 @@ do_mount() {
# Figure out a mount point to use
# LABEL=${ID_FS_LABEL}
LABEL=${DEVBASE}
if grep -q " /media/${LABEL} " /etc/mtab; then
if grep -q " /DATA/USB_Storage_${LABEL} " /etc/mtab; then
# Already in use, make a unique one
LABEL+="-${DEVBASE}"
LABEL+="_${DEVBASE}"
fi
DEV_LABEL="${LABEL}"
@ -44,12 +42,29 @@ do_mount() {
DEV_LABEL="${DEVBASE}"
fi
MOUNT_POINT="/media/${DEV_LABEL}"
MOUNT_POINT="/DATA/USB_Storage_${DEV_LABEL}"
${log} "Mount point: ${MOUNT_POINT}"
mkdir -p ${MOUNT_POINT}
# MOUNT_POINT="/DATA/USB_Storage1"
# arr=("/DATA/USB_Storage1" "/DATA/USB_Storage2" "/DATA/USB_Storage3" "/DATA/USB_Storage4" "/DATA/USB_Storage5" "/DATA/USB_Storage6" "/DATA/USB_Storage7" "/DATA/USB_Storage8" "/DATA/USB_Storage9" "/DATA/USB_Storage10" "/DATA/USB_Storage11" "/DATA/USB_Storage12")
# for folder in ${arr[@]}; do
# #如果文件夹不存在,创建文件夹
# if [ ! -d "$folder" ]; then
# mkdir -p ${folder}
# MOUNT_POINT=$folder
# break
# fi
# done
# ${log} "Mount point: ${MOUNT_POINT}"
# # Global mount options
# OPTS="rw,relatime"
#
@ -86,7 +101,7 @@ do_mount() {
mount -t iso9660 ${DEVICE} ${MOUNT_POINT}
;;
*)
/bin/rmdir "${MOUNT_POINT}"
/bin/rmdir "${MOUNT_POINT}"
exit 0
;;
esac
@ -97,9 +112,12 @@ do_umount() {
if [[ -z ${MOUNT_POINT} ]]; then
${log} "Warning: ${DEVICE} is not mounted"
else
#/bin/kill -9 $(lsof ${MOUNT_POINT})
umount -l ${DEVICE}
${log} "Unmounted ${DEVICE} from ${MOUNT_POINT}"
/bin/rmdir "${MOUNT_POINT}"
if [ "`ls -A ${MOUNT_POINT}`" = "" ]; then
/bin/rm -fr "${MOUNT_POINT}"
fi
sed -i.bak "\@${MOUNT_POINT}@d" /var/log/usb-mount.track
fi

View File

@ -4,5 +4,5 @@ Description=Mount USB Drive on %i
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/oasis/util/shell/usb-mount.sh add %i
ExecStop=/oasis/util/shell/usb-mount.sh remove %i
ExecStart=/casaOS/server/shell/usb-mount.sh add %i
ExecStop=/casaOS/server/shell/usb-mount.sh remove %i

View File

@ -0,0 +1,28 @@
package main
import (
"github.com/IceWhaleTech/CasaOS-Common/external"
"github.com/IceWhaleTech/CasaOS/codegen/message_bus"
"github.com/IceWhaleTech/CasaOS/common"
"github.com/samber/lo"
)
func main() {
eventTypes := lo.Map(common.EventTypes, func(item message_bus.EventType, index int) external.EventType {
return external.EventType{
Name: item.Name,
SourceID: item.SourceID,
PropertyTypeList: lo.Map(
item.PropertyTypeList, func(item message_bus.PropertyType, index int) external.PropertyType {
return external.PropertyType{
Name: item.Name,
Description: item.Description,
Example: item.Example,
}
},
),
}
})
external.PrintEventTypesAsMarkdown(common.SERVICENAME, common.VERSION, eventTypes)
}

37
cmd/migration-tool/log.go Normal file
View File

@ -0,0 +1,37 @@
package main
import (
"log"
"os"
)
type Logger struct {
DebugMode bool
_debug *log.Logger
_info *log.Logger
_error *log.Logger
}
func NewLogger() *Logger {
return &Logger{
DebugMode: false,
_debug: log.New(os.Stdout, "DEBUG: ", 0),
_info: log.New(os.Stdout, "", 0),
_error: log.New(os.Stderr, "ERROR: ", 0),
}
}
func (l *Logger) Debug(format string, v ...interface{}) {
if l.DebugMode {
l._debug.Printf(format, v...)
}
}
func (l *Logger) Info(format string, v ...interface{}) {
l._info.Printf(format, v...)
}
func (l *Logger) Error(format string, v ...interface{}) {
l._error.Printf(format, v...)
}

128
cmd/migration-tool/main.go Normal file
View File

@ -0,0 +1,128 @@
/*
* @Author: LinkLeong link@icewhale.org
* @Date: 2022-08-23 18:09:11
* @LastEditors: LinkLeong
* @LastEditTime: 2022-08-31 14:17:51
* @FilePath: /CasaOS/cmd/migration-tool/main.go
* @Description:
* @Website: https://www.casaos.io
* Copyright (c) 2022 by icewhale, All Rights Reserved.
*/
package main
import (
"flag"
"fmt"
"os"
interfaces "github.com/IceWhaleTech/CasaOS-Common"
"github.com/IceWhaleTech/CasaOS-Common/utils/systemctl"
"github.com/IceWhaleTech/CasaOS/common"
"github.com/IceWhaleTech/CasaOS/pkg/config"
"github.com/IceWhaleTech/CasaOS/pkg/sqlite"
"github.com/IceWhaleTech/CasaOS/service"
"gorm.io/gorm"
)
const (
casaosServiceName = "casaos.service"
)
var (
commit = "private build"
date = "private build"
_logger *Logger
sqliteDB *gorm.DB
configFlag = ""
dbFlag = ""
)
func init() {
versionFlag := flag.Bool("v", false, "version")
debugFlag := flag.Bool("d", true, "debug")
forceFlag := flag.Bool("f", true, "force")
flag.Parse()
if *versionFlag {
fmt.Println("v" + common.VERSION)
os.Exit(0)
}
println("git commit:", commit)
println("build date:", date)
_logger = NewLogger()
if os.Getuid() != 0 {
_logger.Info("Root privileges are required to run this program.")
os.Exit(1)
}
if *debugFlag {
_logger.DebugMode = true
}
if !*forceFlag {
serviceEnabled, err := systemctl.IsServiceEnabled(casaosServiceName)
if err != nil {
panic(err)
}
if serviceEnabled {
_logger.Info("%s is already enabled. If migration is still needed, try with -f.", casaosServiceName)
os.Exit(1)
}
}
config.InitSetup(configFlag, "")
if len(dbFlag) == 0 {
dbFlag = config.AppInfo.DBPath + "/db"
}
sqliteDB = sqlite.GetDb(dbFlag)
// gredis.GetRedisConn(config.RedisInfo),
service.MyService = service.NewService(sqliteDB, "")
}
func main() {
migrationTools := []interfaces.MigrationTool{
// nothing to migrate from last version
}
var selectedMigrationTool interfaces.MigrationTool
// look for the right migration tool matching current version
for _, tool := range migrationTools {
migrationNeeded, err := tool.IsMigrationNeeded()
if err != nil {
panic(err)
}
if migrationNeeded {
selectedMigrationTool = tool
break
}
}
if selectedMigrationTool == nil {
_logger.Error("selectedMigrationTool is null")
return
}
if err := selectedMigrationTool.PreMigrate(); err != nil {
panic(err)
}
if err := selectedMigrationTool.Migrate(); err != nil {
panic(err)
}
if err := selectedMigrationTool.PostMigrate(); err != nil {
_logger.Error("Migration succeeded, but post-migration failed: %s", err)
}
}

View File

@ -0,0 +1,27 @@
package main
import (
interfaces "github.com/IceWhaleTech/CasaOS-Common"
)
type migrationTool struct{}
func (u *migrationTool) IsMigrationNeeded() (bool, error) {
return false, nil
}
func (u *migrationTool) PreMigrate() error {
return nil
}
func (u *migrationTool) Migrate() error {
return nil
}
func (u *migrationTool) PostMigrate() error {
return nil
}
func NewMigrationDummy() interfaces.MigrationTool {
return &migrationTool{}
}

8
common/constants.go Normal file
View File

@ -0,0 +1,8 @@
package common
const (
SERVICENAME = "casaos"
VERSION = "0.4.15"
BODY = " "
RANW_NAME = "IceWhale-RemoteAccess"
)

12
common/message.go Normal file
View File

@ -0,0 +1,12 @@
package common
import (
"github.com/IceWhaleTech/CasaOS/codegen/message_bus"
)
// devtype -> action -> event
var EventTypes = []message_bus.EventType{
{Name: "casaos:system:utilization", SourceID: SERVICENAME, PropertyTypeList: []message_bus.PropertyType{}},
{Name: "casaos:file:recover", SourceID: SERVICENAME, PropertyTypeList: []message_bus.PropertyType{}},
{Name: "casaos:file:operate", SourceID: SERVICENAME, PropertyTypeList: []message_bus.PropertyType{}},
}

25
conf/conf.conf.sample Normal file
View File

@ -0,0 +1,25 @@
[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]
[common]
RuntimePath=/var/run/casaos

View File

@ -1,52 +0,0 @@
[app]
PAGE_SIZE = 10
RuntimeRootPath = runtime/
;LogSavePath = /casaOS/logs/server/
LogSavePath = /oasis/logs/server/
LogSaveName = log
LogFileExt = log
; 必须的格式
DateStrFormat = 20060102
DateTimeFormat = 2006-01-02 15:04:05
TimeFormat = 15:04:05
DateFormat = 2006-01-02
;ProjectPath = /casaOS/server
ProjectPath = /oasis/server
[server]
HttpPort = 8089
RunMode = debug
;ServerApi = http://113.52.135.30:8090
;ServerApi = https://casaos.zimaboard.com
;ServerApi = http://192.168.2.167:8090
ServerApi = http://192.168.2.142:8090
[user]
UserName = admin
PWD = zimaboard
Email = aaa@222.ddd
Description = ddddddd
Token = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImVyZXJlIiwicGFzc3dvcmQiOiJhZHNmZGYiLCJleHAiOjE2MjQwMDU0ODEsImlzcyI6Imdpbi1ibG9nIn0.JNsCccZuFCwlSMLJg62iOIB2xymk_k7xGa11xhZ07bc
[zerotier]
UserName = ddddd
PWD =
Token = yBKYyavr2RdFAIVN7iTpzlsB1o6CqTgm
[redis]
Host = 192.168.2.167:6379
Password =
MaxIdle = 30
MaxActive = 30
IdleTimeout = 200
[system]
AutoUpdate = true
SearchSwitch = true
WidgetsSwitch = false
ShortcutsSwitch = true
SearchEngine = baidu
Background = http://baidu.com1
BackgroundType = d

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

13
drivers/all.go Normal file
View File

@ -0,0 +1,13 @@
package drivers
import (
_ "github.com/IceWhaleTech/CasaOS/drivers/dropbox"
_ "github.com/IceWhaleTech/CasaOS/drivers/google_drive"
_ "github.com/IceWhaleTech/CasaOS/drivers/onedrive"
)
// All do nothing,just for import
// same as _ import
func All() {
}

30
drivers/base/client.go Normal file
View File

@ -0,0 +1,30 @@
package base
import (
"net/http"
"time"
"github.com/go-resty/resty/v2"
)
var NoRedirectClient *resty.Client
var RestyClient = NewRestyClient()
var HttpClient = &http.Client{}
var UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36"
var DefaultTimeout = time.Second * 30
func init() {
NoRedirectClient = resty.New().SetRedirectPolicy(
resty.RedirectPolicyFunc(func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse
}),
)
NoRedirectClient.SetHeader("user-agent", UserAgent)
}
func NewRestyClient() *resty.Client {
return resty.New().
SetHeader("user-agent", UserAgent).
SetRetryCount(3).
SetTimeout(DefaultTimeout)
}

12
drivers/base/types.go Normal file
View File

@ -0,0 +1,12 @@
package base
import "github.com/go-resty/resty/v2"
type Json map[string]interface{}
type TokenResp struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
}
type ReqCallback func(req *resty.Request)

103
drivers/dropbox/drive.go Normal file
View File

@ -0,0 +1,103 @@
package dropbox
import (
"context"
"errors"
"net/http"
"github.com/IceWhaleTech/CasaOS-Common/utils/logger"
"github.com/IceWhaleTech/CasaOS/internal/driver"
"github.com/IceWhaleTech/CasaOS/model"
"github.com/IceWhaleTech/CasaOS/pkg/utils"
"github.com/go-resty/resty/v2"
"go.uber.org/zap"
)
type Dropbox struct {
model.StorageA
Addition
AccessToken string
}
func (d *Dropbox) Config() driver.Config {
return config
}
func (d *Dropbox) GetAddition() driver.Additional {
return &d.Addition
}
func (d *Dropbox) Init(ctx context.Context) error {
if len(d.RefreshToken) == 0 {
d.getRefreshToken()
}
return d.refreshToken()
}
func (d *Dropbox) Drop(ctx context.Context) error {
return nil
}
func (d *Dropbox) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error) {
files, err := d.getFiles(dir.GetID())
if err != nil {
return nil, err
}
return utils.SliceConvert(files, func(src File) (model.Obj, error) {
return fileToObj(src), nil
})
}
func (d *Dropbox) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error) {
url := "https://content.dropboxapi.com/2/files/download"
link := model.Link{
URL: url,
Method: http.MethodPost,
Header: http.Header{
"Authorization": []string{"Bearer " + d.AccessToken},
"Dropbox-API-Arg": []string{`{"path": "` + file.GetPath() + `"}`},
},
}
return &link, nil
}
func (d *Dropbox) GetUserInfo(ctx context.Context) (string, error) {
url := "https://api.dropboxapi.com/2/users/get_current_account"
user := UserInfo{}
resp, err := d.request(url, http.MethodPost, func(req *resty.Request) {
req.SetHeader("Content-Type", "")
}, &user)
if err != nil {
return "", err
}
logger.Info("resp", zap.Any("resp", string(resp)))
return user.Email, nil
}
func (d *Dropbox) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error {
return nil
}
func (d *Dropbox) Move(ctx context.Context, srcObj, dstDir model.Obj) error {
return nil
}
func (d *Dropbox) Rename(ctx context.Context, srcObj model.Obj, newName string) error {
return nil
}
func (d *Dropbox) Copy(ctx context.Context, srcObj, dstDir model.Obj) error {
return errors.New("not support")
}
func (d *Dropbox) Remove(ctx context.Context, obj model.Obj) error {
return nil
}
func (d *Dropbox) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up driver.UpdateProgress) error {
return nil
}
func (d *Dropbox) GetInfo(ctx context.Context) (string, string, string, error) {
return "", "", "", nil
}
var _ driver.Driver = (*Dropbox)(nil)

24
drivers/dropbox/meta.go Normal file
View File

@ -0,0 +1,24 @@
package dropbox
import (
"github.com/IceWhaleTech/CasaOS/internal/driver"
)
const ICONURL = "./img/driver/Dropbox.svg"
type Addition struct {
driver.RootID
RefreshToken string `json:"refresh_token" required:"true" omit:"true"`
AppKey string `json:"app_key" type:"string" default:"tciqajyazzdygt9" omit:"true"`
AppSecret string `json:"app_secret" type:"string" default:"e7gtmv441cwdf0n" omit:"true"`
OrderDirection string `json:"order_direction" type:"select" options:"asc,desc" omit:"true"`
AuthUrl string `json:"auth_url" type:"string" default:""`
Icon string `json:"icon" type:"string" default:"./img/driver/Dropbox.svg"`
Code string `json:"code" type:"string" help:"code from auth_url" omit:"true"`
}
var config = driver.Config{
Name: "Dropbox",
OnlyProxy: true,
DefaultRoot: "root",
}

88
drivers/dropbox/types.go Normal file
View File

@ -0,0 +1,88 @@
package dropbox
import (
"time"
"github.com/IceWhaleTech/CasaOS-Common/utils/logger"
"github.com/IceWhaleTech/CasaOS/model"
"go.uber.org/zap"
)
type UserInfo struct {
AccountID string `json:"account_id"`
Name struct {
GivenName string `json:"given_name"`
Surname string `json:"surname"`
FamiliarName string `json:"familiar_name"`
DisplayName string `json:"display_name"`
AbbreviatedName string `json:"abbreviated_name"`
} `json:"name"`
Email string `json:"email"`
EmailVerified bool `json:"email_verified"`
Disabled bool `json:"disabled"`
Country string `json:"country"`
Locale string `json:"locale"`
ReferralLink string `json:"referral_link"`
IsPaired bool `json:"is_paired"`
AccountType struct {
Tag string `json:".tag"`
} `json:"account_type"`
RootInfo struct {
Tag string `json:".tag"`
RootNamespaceID string `json:"root_namespace_id"`
HomeNamespaceID string `json:"home_namespace_id"`
} `json:"root_info"`
}
type TokenError struct {
Error string `json:"error"`
ErrorDescription string `json:"error_description"`
}
type File struct {
Tag string `json:".tag"`
Name string `json:"name"`
PathLower string `json:"path_lower"`
PathDisplay string `json:"path_display"`
ID string `json:"id"`
ClientModified time.Time `json:"client_modified,omitempty"`
ServerModified time.Time `json:"server_modified,omitempty"`
Rev string `json:"rev,omitempty"`
Size int `json:"size,omitempty"`
IsDownloadable bool `json:"is_downloadable,omitempty"`
ContentHash string `json:"content_hash,omitempty"`
}
type Files struct {
Files []File `json:"entries"`
Cursor string `json:"cursor"`
HasMore bool `json:"has_more"`
}
type Error struct {
Error struct {
Errors []struct {
Domain string `json:"domain"`
Reason string `json:"reason"`
Message string `json:"message"`
LocationType string `json:"location_type"`
Location string `json:"location"`
}
Code int `json:"code"`
Message string `json:"message"`
} `json:"error"`
}
func fileToObj(f File) *model.ObjThumb {
logger.Info("dropbox file", zap.Any("file", f))
obj := &model.ObjThumb{
Object: model.Object{
ID: f.ID,
Name: f.Name,
Size: int64(f.Size),
Modified: f.ClientModified,
IsFolder: f.Tag == "folder",
Path: f.PathDisplay,
},
Thumbnail: model.Thumbnail{},
}
return obj
}

116
drivers/dropbox/util.go Normal file
View File

@ -0,0 +1,116 @@
package dropbox
import (
"fmt"
"net/http"
"github.com/IceWhaleTech/CasaOS-Common/utils/logger"
"github.com/IceWhaleTech/CasaOS/drivers/base"
"github.com/go-resty/resty/v2"
"go.uber.org/zap"
)
var (
app_key = "private build"
app_secret = "private build"
)
func (d *Dropbox) getRefreshToken() error {
url := "https://api.dropbox.com/oauth2/token"
var resp base.TokenResp
var e TokenError
res, err := base.RestyClient.R().SetResult(&resp).SetError(&e).
SetFormData(map[string]string{
"code": d.Code,
"grant_type": "authorization_code",
"redirect_uri": "https://cloudoauth.files.casaos.app",
}).SetBasicAuth(d.Addition.AppKey, d.Addition.AppSecret).SetHeader("Content-Type", "application/x-www-form-urlencoded").Post(url)
if err != nil {
return err
}
logger.Info("get refresh token", zap.String("res", res.String()))
if e.Error != "" {
return fmt.Errorf(e.Error)
}
d.RefreshToken = resp.RefreshToken
return nil
}
func (d *Dropbox) refreshToken() error {
url := "https://api.dropbox.com/oauth2/token"
var resp base.TokenResp
var e TokenError
res, err := base.RestyClient.R().SetResult(&resp).SetError(&e).
SetFormData(map[string]string{
"refresh_token": d.RefreshToken,
"grant_type": "refresh_token",
}).SetBasicAuth(d.Addition.AppKey, d.Addition.AppSecret).SetHeader("Content-Type", "application/x-www-form-urlencoded").Post(url)
if err != nil {
return err
}
logger.Info("get refresh token", zap.String("res", res.String()))
if e.Error != "" {
return fmt.Errorf(e.Error)
}
d.AccessToken = resp.AccessToken
return nil
}
func (d *Dropbox) request(url string, method string, callback base.ReqCallback, resp interface{}) ([]byte, error) {
req := base.RestyClient.R()
req.SetHeader("Authorization", "Bearer "+d.AccessToken)
req.SetHeader("Content-Type", "application/json")
if callback != nil {
callback(req)
}
if resp != nil {
req.SetResult(resp)
}
var e Error
req.SetError(&e)
res, err := req.Execute(method, url)
if err != nil {
return nil, err
}
if e.Error.Code != 0 {
if e.Error.Code == 401 {
err = d.refreshToken()
if err != nil {
return nil, err
}
return d.request(url, method, callback, resp)
}
return nil, fmt.Errorf("%s: %v", e.Error.Message, e.Error.Errors)
}
return res.Body(), nil
}
func (d *Dropbox) getFiles(path string) ([]File, error) {
res := make([]File, 0)
var resp Files
body := base.Json{
"limit": 2000,
"path": path,
}
_, err := d.request("https://api.dropboxapi.com/2/files/list_folder", http.MethodPost, func(req *resty.Request) {
req.SetBody(body)
}, &resp)
if err != nil {
return nil, err
}
res = append(res, resp.Files...)
return res, nil
}
func GetConfig() Dropbox {
dp := Dropbox{}
dp.RootFolderID = ""
dp.AuthUrl = "https://www.dropbox.com/oauth2/authorize?client_id=" + app_key + "&redirect_uri=https://cloudoauth.files.casaos.app&response_type=code&token_access_type=offline&state=${HOST}%2Fv1%2Frecover%2FDropbox&&force_reapprove=true&force_reauthentication=true"
dp.AppKey = app_key
dp.AppSecret = app_secret
dp.Icon = "./img/driver/Dropbox.svg"
return dp
}

View File

@ -0,0 +1,186 @@
package google_drive
import (
"context"
"errors"
"fmt"
"net/http"
"strconv"
"github.com/IceWhaleTech/CasaOS-Common/utils/logger"
"github.com/IceWhaleTech/CasaOS/drivers/base"
"github.com/IceWhaleTech/CasaOS/internal/driver"
"github.com/IceWhaleTech/CasaOS/model"
"github.com/IceWhaleTech/CasaOS/pkg/utils"
"github.com/go-resty/resty/v2"
"go.uber.org/zap"
)
type GoogleDrive struct {
model.StorageA
Addition
AccessToken string
}
func (d *GoogleDrive) Config() driver.Config {
return config
}
func (d *GoogleDrive) GetAddition() driver.Additional {
return &d.Addition
}
func (d *GoogleDrive) Init(ctx context.Context) error {
if d.ChunkSize == 0 {
d.ChunkSize = 5
}
if len(d.RefreshToken) == 0 {
d.getRefreshToken()
}
return d.refreshToken()
}
func (d *GoogleDrive) Drop(ctx context.Context) error {
return nil
}
func (d *GoogleDrive) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error) {
files, err := d.getFiles(dir.GetID())
if err != nil {
return nil, err
}
return utils.SliceConvert(files, func(src File) (model.Obj, error) {
return fileToObj(src), nil
})
}
func (d *GoogleDrive) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error) {
url := fmt.Sprintf("https://www.googleapis.com/drive/v3/files/%s?includeItemsFromAllDrives=true&supportsAllDrives=true", file.GetID())
_, err := d.request(url, http.MethodGet, nil, nil)
if err != nil {
return nil, err
}
link := model.Link{
Method: http.MethodGet,
URL: url + "&alt=media",
Header: http.Header{
"Authorization": []string{"Bearer " + d.AccessToken},
},
}
return &link, nil
}
func (d *GoogleDrive) GetUserInfo(ctx context.Context) (string, error) {
url := "https://content.googleapis.com/drive/v3/about?fields=user"
user := UserInfo{}
resp, err := d.request(url, http.MethodGet, nil, &user)
if err != nil {
return "", err
}
logger.Info("resp", zap.Any("resp", resp))
return user.User.EmailAddress, nil
}
func (d *GoogleDrive) GetInfo(ctx context.Context) (string, string, string, error) {
return "", "", "", nil
}
func (d *GoogleDrive) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error {
data := base.Json{
"name": dirName,
"parents": []string{parentDir.GetID()},
"mimeType": "application/vnd.google-apps.folder",
}
_, err := d.request("https://www.googleapis.com/drive/v3/files", http.MethodPost, func(req *resty.Request) {
req.SetBody(data)
}, nil)
return err
}
func (d *GoogleDrive) Move(ctx context.Context, srcObj, dstDir model.Obj) error {
query := map[string]string{
"addParents": dstDir.GetID(),
"removeParents": "root",
}
url := "https://www.googleapis.com/drive/v3/files/" + srcObj.GetID()
_, err := d.request(url, http.MethodPatch, func(req *resty.Request) {
req.SetQueryParams(query)
}, nil)
return err
}
func (d *GoogleDrive) Rename(ctx context.Context, srcObj model.Obj, newName string) error {
data := base.Json{
"name": newName,
}
url := "https://www.googleapis.com/drive/v3/files/" + srcObj.GetID()
_, err := d.request(url, http.MethodPatch, func(req *resty.Request) {
req.SetBody(data)
}, nil)
return err
}
func (d *GoogleDrive) Copy(ctx context.Context, srcObj, dstDir model.Obj) error {
return errors.New("not support")
}
func (d *GoogleDrive) Remove(ctx context.Context, obj model.Obj) error {
url := "https://www.googleapis.com/drive/v3/files/" + obj.GetID()
_, err := d.request(url, http.MethodDelete, nil, nil)
return err
}
func (d *GoogleDrive) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up driver.UpdateProgress) error {
obj := stream.GetOld()
var (
e Error
url string
data base.Json
res *resty.Response
err error
)
if obj != nil {
url = fmt.Sprintf("https://www.googleapis.com/upload/drive/v3/files/%s?uploadType=resumable&supportsAllDrives=true", obj.GetID())
data = base.Json{}
} else {
data = base.Json{
"name": stream.GetName(),
"parents": []string{dstDir.GetID()},
}
url = "https://www.googleapis.com/upload/drive/v3/files?uploadType=resumable&supportsAllDrives=true"
}
req := base.NoRedirectClient.R().
SetHeaders(map[string]string{
"Authorization": "Bearer " + d.AccessToken,
"X-Upload-Content-Type": stream.GetMimetype(),
"X-Upload-Content-Length": strconv.FormatInt(stream.GetSize(), 10),
}).
SetError(&e).SetBody(data).SetContext(ctx)
if obj != nil {
res, err = req.Patch(url)
} else {
res, err = req.Post(url)
}
if err != nil {
return err
}
if e.Error.Code != 0 {
if e.Error.Code == 401 {
err = d.refreshToken()
if err != nil {
return err
}
return d.Put(ctx, dstDir, stream, up)
}
return fmt.Errorf("%s: %v", e.Error.Message, e.Error.Errors)
}
putUrl := res.Header().Get("location")
if stream.GetSize() < d.ChunkSize*1024*1024 {
_, err = d.request(putUrl, http.MethodPut, func(req *resty.Request) {
req.SetHeader("Content-Length", strconv.FormatInt(stream.GetSize(), 10)).SetBody(stream.GetReadCloser())
}, nil)
} else {
err = d.chunkUpload(ctx, stream, putUrl)
}
return err
}
var _ driver.Driver = (*GoogleDrive)(nil)

View File

@ -0,0 +1,26 @@
package google_drive
import (
"github.com/IceWhaleTech/CasaOS/internal/driver"
)
const ICONURL = "./img/driver/GoogleDrive.svg"
type Addition struct {
driver.RootID
RefreshToken string `json:"refresh_token" required:"true" omit:"true"`
OrderBy string `json:"order_by" type:"string" help:"such as: folder,name,modifiedTime" omit:"true"`
OrderDirection string `json:"order_direction" type:"select" options:"asc,desc" omit:"true"`
ClientID string `json:"client_id" required:"true" default:"" omit:"true"`
ClientSecret string `json:"client_secret" required:"true" default:"" omit:"true"`
ChunkSize int64 `json:"chunk_size" type:"number" help:"chunk size while uploading (unit: MB)" omit:"true"`
AuthUrl string `json:"auth_url" type:"string" default:""`
Icon string `json:"icon" type:"string" default:"./img/driver/GoogleDrive.svg"`
Code string `json:"code" type:"string" help:"code from auth_url" omit:"true"`
}
var config = driver.Config{
Name: "GoogleDrive",
OnlyProxy: true,
DefaultRoot: "root",
}

View File

@ -0,0 +1,77 @@
package google_drive
import (
"strconv"
"time"
"github.com/IceWhaleTech/CasaOS/model"
log "github.com/sirupsen/logrus"
)
type UserInfo struct {
User struct {
Kind string `json:"kind"`
DisplayName string `json:"displayName"`
PhotoLink string `json:"photoLink"`
Me bool `json:"me"`
PermissionID string `json:"permissionId"`
EmailAddress string `json:"emailAddress"`
} `json:"user"`
}
type TokenError struct {
Error string `json:"error"`
ErrorDescription string `json:"error_description"`
}
type Files struct {
NextPageToken string `json:"nextPageToken"`
Files []File `json:"files"`
}
type File struct {
Id string `json:"id"`
Name string `json:"name"`
MimeType string `json:"mimeType"`
ModifiedTime time.Time `json:"modifiedTime"`
Size string `json:"size"`
ThumbnailLink string `json:"thumbnailLink"`
ShortcutDetails struct {
TargetId string `json:"targetId"`
TargetMimeType string `json:"targetMimeType"`
} `json:"shortcutDetails"`
}
func fileToObj(f File) *model.ObjThumb {
log.Debugf("google file: %+v", f)
size, _ := strconv.ParseInt(f.Size, 10, 64)
obj := &model.ObjThumb{
Object: model.Object{
ID: f.Id,
Name: f.Name,
Size: size,
Modified: f.ModifiedTime,
IsFolder: f.MimeType == "application/vnd.google-apps.folder",
},
Thumbnail: model.Thumbnail{},
}
if f.MimeType == "application/vnd.google-apps.shortcut" {
obj.ID = f.ShortcutDetails.TargetId
obj.IsFolder = f.ShortcutDetails.TargetMimeType == "application/vnd.google-apps.folder"
}
return obj
}
type Error struct {
Error struct {
Errors []struct {
Domain string `json:"domain"`
Reason string `json:"reason"`
Message string `json:"message"`
LocationType string `json:"location_type"`
Location string `json:"location"`
}
Code int `json:"code"`
Message string `json:"message"`
} `json:"error"`
}

View File

@ -0,0 +1,167 @@
package google_drive
import (
"context"
"fmt"
"io"
"net/http"
"strconv"
"github.com/IceWhaleTech/CasaOS-Common/utils/logger"
"github.com/IceWhaleTech/CasaOS/drivers/base"
"github.com/IceWhaleTech/CasaOS/model"
"github.com/IceWhaleTech/CasaOS/pkg/utils"
"github.com/go-resty/resty/v2"
log "github.com/sirupsen/logrus"
"go.uber.org/zap"
)
var (
client_id = "private build"
client_secret = "private build"
)
// do others that not defined in Driver interface
func (d *GoogleDrive) getRefreshToken() error {
url := "https://www.googleapis.com/oauth2/v4/token"
var resp base.TokenResp
var e TokenError
res, err := base.RestyClient.R().SetResult(&resp).SetError(&e).
SetFormData(map[string]string{
"client_id": d.ClientID,
"client_secret": d.ClientSecret,
"code": d.Code,
"grant_type": "authorization_code",
"redirect_uri": "https://cloudoauth.files.casaos.app",
}).Post(url)
if err != nil {
return err
}
logger.Info("get refresh token", zap.String("res", res.String()))
if e.Error != "" {
return fmt.Errorf(e.Error)
}
d.RefreshToken = resp.RefreshToken
return nil
}
func (d *GoogleDrive) refreshToken() error {
url := "https://www.googleapis.com/oauth2/v4/token"
var resp base.TokenResp
var e TokenError
res, err := base.RestyClient.R().SetResult(&resp).SetError(&e).
SetFormData(map[string]string{
"client_id": d.ClientID,
"client_secret": d.ClientSecret,
"refresh_token": d.RefreshToken,
"grant_type": "refresh_token",
}).Post(url)
if err != nil {
return err
}
log.Debug(res.String())
if e.Error != "" {
return fmt.Errorf(e.Error)
}
d.AccessToken = resp.AccessToken
return nil
}
func (d *GoogleDrive) request(url string, method string, callback base.ReqCallback, resp interface{}) ([]byte, error) {
req := base.RestyClient.R()
req.SetHeader("Authorization", "Bearer "+d.AccessToken)
req.SetQueryParam("includeItemsFromAllDrives", "true")
req.SetQueryParam("supportsAllDrives", "true")
if callback != nil {
callback(req)
}
if resp != nil {
req.SetResult(resp)
}
var e Error
req.SetError(&e)
res, err := req.Execute(method, url)
if err != nil {
return nil, err
}
if e.Error.Code != 0 {
if e.Error.Code == 401 {
err = d.refreshToken()
if err != nil {
return nil, err
}
return d.request(url, method, callback, resp)
}
return nil, fmt.Errorf("%s: %v", e.Error.Message, e.Error.Errors)
}
return res.Body(), nil
}
func (d *GoogleDrive) getFiles(id string) ([]File, error) {
pageToken := "first"
res := make([]File, 0)
for pageToken != "" {
if pageToken == "first" {
pageToken = ""
}
var resp Files
orderBy := "folder,name,modifiedTime desc"
if d.OrderBy != "" {
orderBy = d.OrderBy + " " + d.OrderDirection
}
query := map[string]string{
"orderBy": orderBy,
"fields": "files(id,name,mimeType,size,modifiedTime,thumbnailLink,shortcutDetails),nextPageToken",
"pageSize": "1000",
"q": fmt.Sprintf("'%s' in parents and trashed = false", id),
//"includeItemsFromAllDrives": "true",
//"supportsAllDrives": "true",
"pageToken": pageToken,
}
_, err := d.request("https://www.googleapis.com/drive/v3/files", http.MethodGet, func(req *resty.Request) {
req.SetQueryParams(query)
}, &resp)
if err != nil {
return nil, err
}
pageToken = resp.NextPageToken
res = append(res, resp.Files...)
}
return res, nil
}
func (d *GoogleDrive) chunkUpload(ctx context.Context, stream model.FileStreamer, url string) error {
var defaultChunkSize = d.ChunkSize * 1024 * 1024
var finish int64 = 0
for finish < stream.GetSize() {
if utils.IsCanceled(ctx) {
return ctx.Err()
}
chunkSize := stream.GetSize() - finish
if chunkSize > defaultChunkSize {
chunkSize = defaultChunkSize
}
_, err := d.request(url, http.MethodPut, func(req *resty.Request) {
req.SetHeaders(map[string]string{
"Content-Length": strconv.FormatInt(chunkSize, 10),
"Content-Range": fmt.Sprintf("bytes %d-%d/%d", finish, finish+chunkSize-1, stream.GetSize()),
}).SetBody(io.LimitReader(stream.GetReadCloser(), chunkSize)).SetContext(ctx)
}, nil)
if err != nil {
return err
}
finish += chunkSize
}
return nil
}
func GetConfig() GoogleDrive {
config := GoogleDrive{}
config.ClientID = client_id
config.ClientSecret = client_secret
config.RootFolderID = "root"
config.AuthUrl = "https://accounts.google.com/o/oauth2/auth/oauthchooseaccount?response_type=code&client_id=" + client_id + "&redirect_uri=https%3A%2F%2Fcloudoauth.files.casaos.app&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&access_type=offline&approval_prompt=force&state=${HOST}%2Fv1%2Frecover%2FGoogleDrive&service=lso&o2v=1&flowName=GeneralOAuthFlow"
config.Icon = "./img/driver/GoogleDrive.svg"
return config
}

73
drivers/onedrive/drive.go Normal file
View File

@ -0,0 +1,73 @@
package onedrive
import (
"context"
"fmt"
"net/http"
"strconv"
"github.com/IceWhaleTech/CasaOS-Common/utils/logger"
"github.com/IceWhaleTech/CasaOS/internal/driver"
"github.com/IceWhaleTech/CasaOS/model"
"go.uber.org/zap"
)
type Onedrive struct {
model.StorageA
Addition
AccessToken string
}
func (d *Onedrive) Config() driver.Config {
return config
}
func (d *Onedrive) GetAddition() driver.Additional {
return &d.Addition
}
func (d *Onedrive) Init(ctx context.Context) error {
if d.ChunkSize < 1 {
d.ChunkSize = 5
}
if len(d.RefreshToken) == 0 {
return d.getRefreshToken()
}
return d.refreshToken()
}
func (d *Onedrive) GetUserInfo(ctx context.Context) (string, error) {
return "", nil
}
func (d *Onedrive) GetInfo(ctx context.Context) (string, string, string, error) {
url := d.GetMetaUrl(false, "/")
user := Info{}
_, err := d.Request(url, http.MethodGet, nil, &user)
if err != nil {
return "", "", "", err
}
return user.CreatedBy.User.Email, user.ParentReference.DriveID, user.ParentReference.DriveType, nil
}
func (d *Onedrive) GetSpaceSize(ctx context.Context) (used string, total string, err error) {
host := onedriveHostMap[d.Region]
url := fmt.Sprintf("%s/v1.0/me/drive/quota", host.Api)
size := About{}
resp, err := d.Request(url, http.MethodGet, nil, &size)
if err != nil {
return used, total, err
}
logger.Info("resp", zap.Any("resp", resp))
used = strconv.Itoa(size.Used)
total = strconv.Itoa(size.Total)
return
}
func (d *Onedrive) Drop(ctx context.Context) error {
return nil
}
var _ driver.Driver = (*Onedrive)(nil)

62
drivers/onedrive/meta.go Normal file
View File

@ -0,0 +1,62 @@
package onedrive
import (
"github.com/IceWhaleTech/CasaOS/internal/driver"
)
const ICONURL = "./img/driver/OneDrive.svg"
type Host struct {
Oauth string
Api string
}
type TokenErr struct {
Error string `json:"error"`
ErrorDescription string `json:"error_description"`
}
type RespErr struct {
Error struct {
Code string `json:"code"`
Message string `json:"message"`
} `json:"error"`
}
type Addition struct {
Region string `json:"region" type:"select" required:"true" options:"global,cn,us,de" default:"global"`
IsSharepoint bool `json:"is_sharepoint"`
ClientID string `json:"client_id" required:"true"`
ClientSecret string `json:"client_secret" required:"true"`
RedirectUri string `json:"redirect_uri" required:"true" default:""`
RefreshToken string `json:"refresh_token" required:"true"`
SiteId string `json:"site_id"`
ChunkSize int64 `json:"chunk_size" type:"number" default:"5"`
RootFolderID string `json:"root_folder_id"`
AuthUrl string `json:"auth_url" type:"string" default:""`
Icon string `json:"icon" type:"string" default:""`
Code string `json:"code" type:"string" help:"code from auth_url" omit:"true"`
}
type About struct {
Total int `json:"total"`
Used int `json:"used"`
State string `json:"state"`
}
type Info struct {
CreatedBy struct {
User struct {
Email string `json:"email"`
DisplayName string `json:"displayName"`
} `json:"user"`
} `json:"createdBy"`
ParentReference struct {
DriveID string `json:"driveId"`
DriveType string `json:"driveType"`
} `json:"parentReference"`
}
var config = driver.Config{
Name: "Onedrive",
LocalSort: true,
DefaultRoot: "/",
}

160
drivers/onedrive/util.go Normal file
View File

@ -0,0 +1,160 @@
package onedrive
import (
"errors"
"fmt"
"github.com/IceWhaleTech/CasaOS-Common/utils/logger"
"github.com/IceWhaleTech/CasaOS/drivers/base"
"github.com/IceWhaleTech/CasaOS/pkg/utils"
"go.uber.org/zap"
)
var (
client_id = "private build"
client_secret = "private build"
)
var onedriveHostMap = map[string]Host{
"global": {
Oauth: "https://login.microsoftonline.com",
Api: "https://graph.microsoft.com",
},
"cn": {
Oauth: "https://login.chinacloudapi.cn",
Api: "https://microsoftgraph.chinacloudapi.cn",
},
"us": {
Oauth: "https://login.microsoftonline.us",
Api: "https://graph.microsoft.us",
},
"de": {
Oauth: "https://login.microsoftonline.de",
Api: "https://graph.microsoft.de",
},
}
func (d *Onedrive) GetMetaUrl(auth bool, path string) string {
host := onedriveHostMap[d.Region]
path = utils.EncodePath(path, true)
if auth {
return host.Oauth
}
if d.IsSharepoint {
if path == "/" || path == "\\" {
return fmt.Sprintf("%s/v1.0/sites/%s/drive/root", host.Api, d.SiteId)
} else {
return fmt.Sprintf("%s/v1.0/sites/%s/drive/root:%s:", host.Api, d.SiteId, path)
}
} else {
if path == "/" || path == "\\" {
return fmt.Sprintf("%s/v1.0/me/drive/root", host.Api)
} else {
return fmt.Sprintf("%s/v1.0/me/drive/root:%s:", host.Api, path)
}
}
}
func (d *Onedrive) refreshToken() error {
var err error
for i := 0; i < 3; i++ {
err = d._refreshToken()
if err == nil {
break
}
}
return err
}
func (d *Onedrive) getRefreshToken() error {
url := d.GetMetaUrl(true, "") + "/common/oauth2/v2.0/token"
var resp base.TokenResp
var e TokenErr
res, err := base.RestyClient.R().SetResult(&resp).SetError(&e).SetFormData(map[string]string{
"grant_type": "authorization_code",
"client_id": d.ClientID,
"client_secret": d.ClientSecret,
"code": d.Code,
"redirect_uri": d.RedirectUri,
}).Post(url)
if err != nil {
return err
}
logger.Info("get refresh token", zap.String("res", res.String()))
if e.Error != "" {
return fmt.Errorf("%s", e.ErrorDescription)
}
if resp.RefreshToken == "" {
return errors.New("refresh token is empty")
}
d.RefreshToken, d.AccessToken = resp.RefreshToken, resp.AccessToken
return nil
}
func (d *Onedrive) _refreshToken() error {
url := d.GetMetaUrl(true, "") + "/common/oauth2/v2.0/token"
var resp base.TokenResp
var e TokenErr
res, err := base.RestyClient.R().SetResult(&resp).SetError(&e).SetFormData(map[string]string{
"grant_type": "refresh_token",
"client_id": d.ClientID,
"client_secret": d.ClientSecret,
"redirect_uri": d.RedirectUri,
"refresh_token": d.RefreshToken,
}).Post(url)
if err != nil {
return err
}
logger.Info("get refresh token", zap.String("res", res.String()))
if e.Error != "" {
return fmt.Errorf("%s", e.ErrorDescription)
}
if resp.RefreshToken == "" {
return errors.New("refresh token is empty")
}
d.RefreshToken, d.AccessToken = resp.RefreshToken, resp.AccessToken
return nil
}
func (d *Onedrive) Request(url string, method string, callback base.ReqCallback, resp interface{}) ([]byte, error) {
req := base.RestyClient.R()
req.SetHeader("Authorization", "Bearer "+d.AccessToken)
if callback != nil {
callback(req)
}
if resp != nil {
req.SetResult(resp)
}
var e RespErr
req.SetError(&e)
res, err := req.Execute(method, url)
if err != nil {
return nil, err
}
if e.Error.Code != "" {
if e.Error.Code == "InvalidAuthenticationToken" {
err = d.refreshToken()
if err != nil {
return nil, err
}
return d.Request(url, method, callback, resp)
}
return nil, errors.New(e.Error.Message)
}
return res.Body(), nil
}
func GetConfig() Onedrive {
config := Onedrive{}
config.ClientID = client_id
config.ClientSecret = client_secret
config.RootFolderID = "/"
config.AuthUrl = "https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=" + client_id + "&response_type=code&redirect_uri=https%3A%2F%2Fcloudoauth.files.casaos.app&scope=offline_access+files.readwrite.all&state=${HOST}%2Fv1%2Frecover%2FOnedrive"
config.Icon = "./img/driver/OneDrive.svg"
config.Region = "global"
config.RedirectUri = "https://cloudoauth.files.casaos.app"
return config
}

188
go.mod
View File

@ -1,76 +1,126 @@
module github.com/IceWhaleTech/CasaOS
go 1.16
go 1.21
require (
github.com/Microsoft/go-winio v0.5.0 // indirect
github.com/Microsoft/hcsshim v0.8.22 // indirect
github.com/PuerkitoBio/goquery v1.7.0
github.com/StackExchange/wmi v0.0.0-20210224194228-fe8f1750fd46 // indirect
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
github.com/bits-and-blooms/bitset v1.2.1 // indirect
github.com/containerd/containerd v1.5.5
github.com/containerd/continuity v0.2.0 // indirect
github.com/docker/docker v20.10.7+incompatible
github.com/docker/go-connections v0.4.0
github.com/forease/gotld v0.0.0-20190808124948-c50ff635576b
github.com/gin-contrib/gzip v0.0.2 // indirect
github.com/gin-gonic/gin v1.7.2
github.com/go-ini/ini v1.62.0
github.com/go-ole/go-ole v1.2.5 // indirect
github.com/go-openapi/jsonreference v0.19.6 // indirect
github.com/go-openapi/spec v0.20.3 // indirect
github.com/go-openapi/swag v0.19.15 // indirect
github.com/go-playground/validator/v10 v10.6.1 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/gomodule/redigo v1.8.5
github.com/Curtis-Milo/nat-type-identifier-go v0.0.0-20220215191915-18d42168c63d
github.com/IceWhaleTech/CasaOS-Common v0.4.11-alpha4
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf
github.com/deckarep/golang-set/v2 v2.3.0
github.com/deepmap/oapi-codegen v1.12.4
github.com/disintegration/imaging v1.6.2
github.com/dsoprea/go-exif/v3 v3.0.1
github.com/getkin/kin-openapi v0.117.0
github.com/glebarez/sqlite v1.8.0
github.com/go-ini/ini v1.67.0
github.com/go-resty/resty/v2 v2.7.0
github.com/golang/mock v1.6.0
github.com/gomodule/redigo v1.8.9
github.com/google/go-github/v36 v36.0.0
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/websocket v1.4.2
github.com/jinzhu/copier v0.3.2
github.com/json-iterator/go v1.1.11 // indirect
github.com/klauspost/compress v1.13.6 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-isatty v0.0.13 // indirect
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/opencontainers/runc v1.0.2 // indirect
github.com/opencontainers/selinux v1.8.5 // indirect
github.com/google/uuid v1.5.0
github.com/googollee/go-socket.io v1.7.0
github.com/gorilla/websocket v1.5.0
github.com/h2non/filetype v1.1.3
github.com/hirochachacha/go-smb2 v1.1.0
github.com/json-iterator/go v1.1.12
github.com/labstack/echo/v4 v4.12.0
github.com/maruel/natural v1.1.0
github.com/mholt/archiver/v3 v3.5.1
github.com/mileusna/useragent v1.2.1
github.com/moby/sys/mount v0.3.3
github.com/moby/sys/mountinfo v0.6.2
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/pkg/errors v0.9.1
github.com/prestonTao/upnp v0.0.0-20150206124352-f4370df5e109
github.com/prometheus/procfs v0.7.3 // indirect
github.com/robfig/cron v1.2.0
github.com/satori/go.uuid v1.2.0
github.com/shirou/gopsutil/v3 v3.21.5
github.com/sirupsen/logrus v1.8.1
github.com/smartystreets/assertions v1.2.0 // indirect
github.com/smartystreets/goconvey v1.6.4 // indirect
github.com/swaggo/gin-swagger v1.3.0
github.com/swaggo/swag v1.7.0
github.com/tidwall/gjson v1.8.0
github.com/tidwall/pretty v1.2.0 // indirect
github.com/tklauser/go-sysconf v0.3.6 // indirect
github.com/ugorji/go v1.2.6 // indirect
go.opencensus.io v0.23.0 // indirect
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5
golang.org/x/mod v0.5.0 // indirect
golang.org/x/net v0.0.0-20210924151903-3ad01bbaa167 // indirect
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f
golang.org/x/sys v0.0.0-20210927052749-1cf2251ac284 // indirect
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
golang.org/x/tools v0.1.5 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0 // indirect
google.golang.org/grpc v1.41.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
gorm.io/driver/sqlite v1.1.5
gorm.io/gorm v1.21.15
github.com/robfig/cron/v3 v3.0.1
github.com/samber/lo v1.38.1
github.com/shirou/gopsutil/v3 v3.23.2
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.9.0
github.com/tidwall/gjson v1.17.0
go.uber.org/goleak v1.2.1
go.uber.org/zap v1.24.0
golang.org/x/crypto v0.23.0
golang.org/x/oauth2 v0.7.0
golang.org/x/sync v0.3.0
golang.org/x/sys v0.20.0
gorm.io/gorm v1.25.0
gotest.tools v2.2.0+incompatible
)
require (
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/benbjohnson/clock v1.3.1 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
github.com/dsoprea/go-logging v0.0.0-20200710184922-b02d349568dd // indirect
github.com/dsoprea/go-utility/v2 v2.0.0-20221003172846-a3e1774ef349 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/geoffgarside/ber v1.1.0 // indirect
github.com/glebarez/go-sqlite v1.21.1 // indirect
github.com/go-errors/errors v1.4.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/gofrs/uuid v4.4.0+incompatible // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang-jwt/jwt/v5 v5.0.0 // indirect
github.com/golang/geo v0.0.0-20210211234256-740aa86cb551 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/safetext v0.0.0-20240104143208-7a7d9b3d812f // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/invopop/yaml v0.2.0 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/klauspost/pgzip v1.2.5 // indirect
github.com/labstack/echo-jwt/v4 v4.2.0 // indirect
github.com/labstack/gommon v0.4.2 // indirect
github.com/lufia/plan9stats v0.0.0-20230110061619-bbe2e5e100de // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/nwaples/rardecode v1.1.3 // indirect
github.com/perimeterx/marshmallow v1.1.4 // indirect
github.com/pierrec/lz4/v4 v4.1.17 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tklauser/go-sysconf v0.3.11 // indirect
github.com/tklauser/numcpus v0.6.0 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 // indirect
golang.org/x/image v0.6.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
modernc.org/libc v1.22.4 // indirect
modernc.org/mathutil v1.5.0 // indirect
modernc.org/memory v1.5.0 // indirect
modernc.org/sqlite v1.21.2 // indirect
mvdan.cc/sh/v3 v3.7.0 // indirect
)

1465
go.sum

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,18 @@
/*
* @Author: LinkLeong link@icewhale.org
* @Date: 2022-08-24 17:37:36
* @LastEditors: LinkLeong
* @LastEditTime: 2022-08-24 17:38:48
* @FilePath: /CasaOS/interfaces/migrationTool.go
* @Description:
* @Website: https://www.casaos.io
* Copyright (c) 2022 by icewhale, All Rights Reserved.
*/
package interfaces
type MigrationTool interface {
IsMigrationNeeded() (bool, error)
PostMigrate() error
Migrate() error
PreMigrate() error
}

43
internal/conf/config.go Normal file
View File

@ -0,0 +1,43 @@
package conf
type Database struct {
Type string `json:"type" env:"DB_TYPE"`
Host string `json:"host" env:"DB_HOST"`
Port int `json:"port" env:"DB_PORT"`
User string `json:"user" env:"DB_USER"`
Password string `json:"password" env:"DB_PASS"`
Name string `json:"name" env:"DB_NAME"`
DBFile string `json:"db_file" env:"DB_FILE"`
TablePrefix string `json:"table_prefix" env:"DB_TABLE_PREFIX"`
SSLMode string `json:"ssl_mode" env:"DB_SSL_MODE"`
}
type Scheme struct {
Https bool `json:"https" env:"HTTPS"`
CertFile string `json:"cert_file" env:"CERT_FILE"`
KeyFile string `json:"key_file" env:"KEY_FILE"`
}
type LogConfig struct {
Enable bool `json:"enable" env:"LOG_ENABLE"`
Name string `json:"name" env:"LOG_NAME"`
MaxSize int `json:"max_size" env:"MAX_SIZE"`
MaxBackups int `json:"max_backups" env:"MAX_BACKUPS"`
MaxAge int `json:"max_age" env:"MAX_AGE"`
Compress bool `json:"compress" env:"COMPRESS"`
}
type Config struct {
Force bool `json:"force" env:"FORCE"`
Address string `json:"address" env:"ADDR"`
Port int `json:"port" env:"PORT"`
SiteURL string `json:"site_url" env:"SITE_URL"`
Cdn string `json:"cdn" env:"CDN"`
JwtSecret string `json:"jwt_secret" env:"JWT_SECRET"`
TokenExpiresIn int `json:"token_expires_in" env:"TOKEN_EXPIRES_IN"`
Database Database `json:"database"`
Scheme Scheme `json:"scheme"`
TempDir string `json:"temp_dir" env:"TEMP_DIR"`
BleveDir string `json:"bleve_dir" env:"BLEVE_DIR"`
Log LogConfig `json:"log"`
}

72
internal/conf/const.go Normal file
View File

@ -0,0 +1,72 @@
package conf
const (
TypeString = "string"
TypeSelect = "select"
TypeBool = "bool"
TypeText = "text"
TypeNumber = "number"
)
const (
// site
VERSION = "version"
ApiUrl = "api_url"
BasePath = "base_path"
SiteTitle = "site_title"
Announcement = "announcement"
AllowIndexed = "allow_indexed"
Logo = "logo"
Favicon = "favicon"
MainColor = "main_color"
// preview
TextTypes = "text_types"
AudioTypes = "audio_types"
VideoTypes = "video_types"
ImageTypes = "image_types"
ProxyTypes = "proxy_types"
ProxyIgnoreHeaders = "proxy_ignore_headers"
AudioAutoplay = "audio_autoplay"
VideoAutoplay = "video_autoplay"
// global
HideFiles = "hide_files"
CustomizeHead = "customize_head"
CustomizeBody = "customize_body"
LinkExpiration = "link_expiration"
SignAll = "sign_all"
PrivacyRegs = "privacy_regs"
OcrApi = "ocr_api"
FilenameCharMapping = "filename_char_mapping"
// index
SearchIndex = "search_index"
AutoUpdateIndex = "auto_update_index"
IndexPaths = "index_paths"
IgnorePaths = "ignore_paths"
// aria2
Aria2Uri = "aria2_uri"
Aria2Secret = "aria2_secret"
// single
Token = "token"
IndexProgress = "index_progress"
//Github
GithubClientId = "github_client_id"
GithubClientSecrets = "github_client_secrets"
GithubLoginEnabled = "github_login_enabled"
)
const (
UNKNOWN = iota
FOLDER
//OFFICE
VIDEO
AUDIO
TEXT
IMAGE
)

30
internal/conf/var.go Normal file
View File

@ -0,0 +1,30 @@
package conf
import "regexp"
var (
BuiltAt string
GoVersion string
GitAuthor string
GitCommit string
Version string = "dev"
WebVersion string
)
var (
Conf *Config
)
var SlicesMap = make(map[string][]string)
var FilenameCharMap = make(map[string]string)
var PrivacyReg []*regexp.Regexp
var (
// StoragesLoaded loaded success if empty
StoragesLoaded = false
)
var (
RawIndexHtml string
ManageHtml string
IndexHtml string
)

25
internal/driver/config.go Normal file
View File

@ -0,0 +1,25 @@
/*
* @Author: a624669980@163.com a624669980@163.com
* @Date: 2022-12-13 11:05:05
* @LastEditors: a624669980@163.com a624669980@163.com
* @LastEditTime: 2022-12-13 11:05:13
* @FilePath: /drive/internal/driver/config.go
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
package driver
type Config struct {
Name string `json:"name"`
LocalSort bool `json:"local_sort"`
OnlyLocal bool `json:"only_local"`
OnlyProxy bool `json:"only_proxy"`
NoCache bool `json:"no_cache"`
NoUpload bool `json:"no_upload"`
NeedMs bool `json:"need_ms"` // if need get message from user, such as validate code
DefaultRoot string `json:"default_root"`
CheckStatus bool
}
func (c Config) MustProxy() bool {
return c.OnlyProxy || c.OnlyLocal
}

133
internal/driver/driver.go Normal file
View File

@ -0,0 +1,133 @@
package driver
import (
"context"
"github.com/IceWhaleTech/CasaOS/model"
)
type Driver interface {
Meta
Reader
User
//Writer
//Other
}
type Meta interface {
Config() Config
// GetStorage just get raw storage, no need to implement, because model.Storage have implemented
GetStorage() *model.StorageA
SetStorage(model.StorageA)
// GetAddition Additional is used for unmarshal of JSON, so need return pointer
GetAddition() Additional
// Init If already initialized, drop first
Init(ctx context.Context) error
Drop(ctx context.Context) error
}
type Other interface {
Other(ctx context.Context, args model.OtherArgs) (interface{}, error)
}
type Reader interface {
// List files in the path
// if identify files by path, need to set ID with path,like path.Join(dir.GetID(), obj.GetName())
// if identify files by id, need to set ID with corresponding id
// List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)
// Link get url/filepath/reader of file
// Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)
}
type User interface {
// GetRoot get root directory of user
GetUserInfo(ctx context.Context) (string, error)
GetInfo(ctx context.Context) (string, string, string, error)
}
type Getter interface {
GetRoot(ctx context.Context) (model.Obj, error)
}
//type Writer interface {
// Mkdir
// Move
// Rename
// Copy
// Remove
// Put
//}
type Mkdir interface {
MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error
}
type Move interface {
Move(ctx context.Context, srcObj, dstDir model.Obj) error
}
type Rename interface {
Rename(ctx context.Context, srcObj model.Obj, newName string) error
}
type Copy interface {
Copy(ctx context.Context, srcObj, dstDir model.Obj) error
}
type Remove interface {
Remove(ctx context.Context, obj model.Obj) error
}
type Put interface {
Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up UpdateProgress) error
}
//type WriteResult interface {
// MkdirResult
// MoveResult
// RenameResult
// CopyResult
// PutResult
// Remove
//}
type MkdirResult interface {
MakeDir(ctx context.Context, parentDir model.Obj, dirName string) (model.Obj, error)
}
type MoveResult interface {
Move(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error)
}
type RenameResult interface {
Rename(ctx context.Context, srcObj model.Obj, newName string) (model.Obj, error)
}
type CopyResult interface {
Copy(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error)
}
type PutResult interface {
Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up UpdateProgress) (model.Obj, error)
}
type UpdateProgress func(percentage int)
type Progress struct {
Total int64
Done int64
up UpdateProgress
}
func (p *Progress) Write(b []byte) (n int, err error) {
n = len(b)
p.Done += int64(n)
p.up(int(float64(p.Done) / float64(p.Total) * 100))
return
}
func NewProgress(total int64, up UpdateProgress) *Progress {
return &Progress{
Total: total,
up: up,
}
}

56
internal/driver/item.go Normal file
View File

@ -0,0 +1,56 @@
/*
* @Author: a624669980@163.com a624669980@163.com
* @Date: 2022-12-13 11:05:47
* @LastEditors: a624669980@163.com a624669980@163.com
* @LastEditTime: 2022-12-13 11:05:54
* @FilePath: /drive/internal/driver/item.go
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
package driver
type Additional interface{}
type Select string
type Item struct {
Name string `json:"name"`
Type string `json:"type"`
Default string `json:"default"`
Options string `json:"options"`
Required bool `json:"required"`
Help string `json:"help"`
}
type Info struct {
Common []Item `json:"common"`
Additional []Item `json:"additional"`
Config Config `json:"config"`
}
type IRootPath interface {
GetRootPath() string
}
type IRootId interface {
GetRootId() string
}
type RootPath struct {
RootFolderPath string `json:"root_folder_path"`
}
type RootID struct {
RootFolderID string `json:"root_folder_id" omit:"true"`
}
func (r RootPath) GetRootPath() string {
return r.RootFolderPath
}
func (r *RootPath) SetRootPath(path string) {
r.RootFolderPath = path
}
func (r RootID) GetRootId() string {
return r.RootFolderID
}

6
internal/op/const.go Normal file
View File

@ -0,0 +1,6 @@
package op
const (
WORK = "work"
RootName = "root"
)

173
internal/op/driver.go Normal file
View File

@ -0,0 +1,173 @@
package op
import (
"reflect"
"strings"
"github.com/IceWhaleTech/CasaOS/internal/conf"
"github.com/IceWhaleTech/CasaOS/internal/driver"
"github.com/pkg/errors"
)
type New func() driver.Driver
var driverNewMap = map[string]New{}
var driverInfoMap = map[string][]driver.Item{} //driver.Info{}
func RegisterDriver(driver New) {
// log.Infof("register driver: [%s]", config.Name)
tempDriver := driver()
tempConfig := tempDriver.Config()
registerDriverItems(tempConfig, tempDriver.GetAddition())
driverNewMap[tempConfig.Name] = driver
}
func GetDriverNew(name string) (New, error) {
n, ok := driverNewMap[name]
if !ok {
return nil, errors.Errorf("no driver named: %s", name)
}
return n, nil
}
func GetDriverNames() []string {
var driverNames []string
for k := range driverInfoMap {
driverNames = append(driverNames, k)
}
return driverNames
}
// func GetDriverInfoMap() map[string]driver.Info {
// return driverInfoMap
// }
func GetDriverInfoMap() map[string][]driver.Item {
return driverInfoMap
}
func registerDriverItems(config driver.Config, addition driver.Additional) {
// log.Debugf("addition of %s: %+v", config.Name, addition)
tAddition := reflect.TypeOf(addition)
for tAddition.Kind() == reflect.Pointer {
tAddition = tAddition.Elem()
}
//mainItems := getMainItems(config)
additionalItems := getAdditionalItems(tAddition, config.DefaultRoot)
driverInfoMap[config.Name] = additionalItems
// driver.Info{
// Common: mainItems,
// Additional: additionalItems,
// Config: config,
// }
}
func getMainItems(config driver.Config) []driver.Item {
items := []driver.Item{{
Name: "mount_path",
Type: conf.TypeString,
Required: true,
Help: "",
}, {
Name: "order",
Type: conf.TypeNumber,
Help: "use to sort",
}, {
Name: "remark",
Type: conf.TypeText,
}}
if !config.NoCache {
items = append(items, driver.Item{
Name: "cache_expiration",
Type: conf.TypeNumber,
Default: "30",
Required: true,
Help: "The cache expiration time for this storage",
})
}
if !config.OnlyProxy && !config.OnlyLocal {
items = append(items, []driver.Item{{
Name: "web_proxy",
Type: conf.TypeBool,
}, {
Name: "webdav_policy",
Type: conf.TypeSelect,
Options: "302_redirect,use_proxy_url,native_proxy",
Default: "302_redirect",
Required: true,
},
}...)
} else {
items = append(items, driver.Item{
Name: "webdav_policy",
Type: conf.TypeSelect,
Default: "native_proxy",
Options: "use_proxy_url,native_proxy",
Required: true,
})
}
items = append(items, driver.Item{
Name: "down_proxy_url",
Type: conf.TypeText,
})
if config.LocalSort {
items = append(items, []driver.Item{{
Name: "order_by",
Type: conf.TypeSelect,
Options: "name,size,modified",
}, {
Name: "order_direction",
Type: conf.TypeSelect,
Options: "asc,desc",
}}...)
}
items = append(items, driver.Item{
Name: "extract_folder",
Type: conf.TypeSelect,
Options: "front,back",
})
return items
}
func getAdditionalItems(t reflect.Type, defaultRoot string) []driver.Item {
var items []driver.Item
for i := 0; i < t.NumField(); i++ {
field := t.Field(i)
if field.Type.Kind() == reflect.Struct {
items = append(items, getAdditionalItems(field.Type, defaultRoot)...)
continue
}
tag := field.Tag
ignore, ok1 := tag.Lookup("ignore")
name, ok2 := tag.Lookup("json")
if (ok1 && ignore == "true") || !ok2 {
continue
}
if tag.Get("omit") == "true" {
continue
}
item := driver.Item{
Name: name,
Type: strings.ToLower(field.Type.Name()),
Default: tag.Get("default"),
Options: tag.Get("options"),
Required: tag.Get("required") == "true",
Help: tag.Get("help"),
}
if tag.Get("type") != "" {
item.Type = tag.Get("type")
}
if item.Name == "root_folder_id" || item.Name == "root_folder_path" {
if item.Default == "" {
item.Default = defaultRoot
}
item.Required = item.Default != ""
}
// set default type to string
if item.Type == "" {
item.Type = "string"
}
items = append(items, item)
}
return items
}

109
internal/op/hook.go Normal file
View File

@ -0,0 +1,109 @@
package op
import (
"regexp"
"strings"
"github.com/IceWhaleTech/CasaOS-Common/utils/logger"
"github.com/IceWhaleTech/CasaOS/internal/conf"
"github.com/IceWhaleTech/CasaOS/internal/driver"
"github.com/IceWhaleTech/CasaOS/model"
jsoniter "github.com/json-iterator/go"
"github.com/pkg/errors"
"go.uber.org/zap"
)
// Obj
type ObjsUpdateHook = func(parent string, objs []model.Obj)
var (
ObjsUpdateHooks = make([]ObjsUpdateHook, 0)
)
func RegisterObjsUpdateHook(hook ObjsUpdateHook) {
ObjsUpdateHooks = append(ObjsUpdateHooks, hook)
}
func HandleObjsUpdateHook(parent string, objs []model.Obj) {
for _, hook := range ObjsUpdateHooks {
hook(parent, objs)
}
}
// Setting
type SettingItemHook func(item *model.SettingItem) error
var settingItemHooks = map[string]SettingItemHook{
conf.VideoTypes: func(item *model.SettingItem) error {
conf.SlicesMap[conf.VideoTypes] = strings.Split(item.Value, ",")
return nil
},
conf.AudioTypes: func(item *model.SettingItem) error {
conf.SlicesMap[conf.AudioTypes] = strings.Split(item.Value, ",")
return nil
},
conf.ImageTypes: func(item *model.SettingItem) error {
conf.SlicesMap[conf.ImageTypes] = strings.Split(item.Value, ",")
return nil
},
conf.TextTypes: func(item *model.SettingItem) error {
conf.SlicesMap[conf.TextTypes] = strings.Split(item.Value, ",")
return nil
},
conf.ProxyTypes: func(item *model.SettingItem) error {
conf.SlicesMap[conf.ProxyTypes] = strings.Split(item.Value, ",")
return nil
},
conf.ProxyIgnoreHeaders: func(item *model.SettingItem) error {
conf.SlicesMap[conf.ProxyIgnoreHeaders] = strings.Split(item.Value, ",")
return nil
},
conf.PrivacyRegs: func(item *model.SettingItem) error {
regStrs := strings.Split(item.Value, "\n")
regs := make([]*regexp.Regexp, 0, len(regStrs))
for _, regStr := range regStrs {
reg, err := regexp.Compile(regStr)
if err != nil {
return errors.WithStack(err)
}
regs = append(regs, reg)
}
conf.PrivacyReg = regs
return nil
},
conf.FilenameCharMapping: func(item *model.SettingItem) error {
var json = jsoniter.ConfigCompatibleWithStandardLibrary
err := json.UnmarshalFromString(item.Value, &conf.FilenameCharMap)
if err != nil {
return err
}
logger.Info("filename char mapping", zap.Any("FilenameCharMap", conf.FilenameCharMap))
return nil
},
}
func RegisterSettingItemHook(key string, hook SettingItemHook) {
settingItemHooks[key] = hook
}
func HandleSettingItemHook(item *model.SettingItem) (hasHook bool, err error) {
if hook, ok := settingItemHooks[item.Key]; ok {
return true, hook(item)
}
return false, nil
}
// Storage
type StorageHook func(typ string, storage driver.Driver)
var storageHooks = make([]StorageHook, 0)
func CallStorageHooks(typ string, storage driver.Driver) {
for _, hook := range storageHooks {
hook(typ, storage)
}
}
func RegisterStorageHook(hook StorageHook) {
storageHooks = append(storageHooks, hook)
}

36
internal/sign/sign.go Normal file
View File

@ -0,0 +1,36 @@
package sign
import (
"sync"
"time"
"github.com/IceWhaleTech/CasaOS/pkg/sign"
)
var once sync.Once
var instance sign.Sign
func Sign(data string) string {
return NotExpired(data)
}
func WithDuration(data string, d time.Duration) string {
once.Do(Instance)
return instance.Sign(data, time.Now().Add(d).Unix())
}
func NotExpired(data string) string {
once.Do(Instance)
return instance.Sign(data, 0)
}
func Verify(data string, sign string) error {
once.Do(Instance)
return instance.Verify(data, sign)
}
func Instance() {
instance = sign.NewHMACSign([]byte("token"))
}

229
main.go
View File

@ -1,70 +1,229 @@
//go:generate bash -c "mkdir -p codegen && go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen@v1.12.4 -generate types,server,spec -package codegen api/casaos/openapi.yaml > codegen/casaos_api.go"
//go:generate bash -c "mkdir -p codegen/message_bus && go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen@v1.12.4 -generate types,client -package message_bus https://raw.githubusercontent.com/IceWhaleTech/CasaOS-MessageBus/main/api/message_bus/openapi.yaml > codegen/message_bus/api.go"
package main
import (
"context"
_ "embed"
"flag"
"fmt"
"net"
"net/http"
"path/filepath"
"time"
"github.com/IceWhaleTech/CasaOS-Common/model"
"github.com/IceWhaleTech/CasaOS-Common/utils/command"
"github.com/IceWhaleTech/CasaOS-Common/utils/constants"
"github.com/IceWhaleTech/CasaOS-Common/utils/logger"
util_http "github.com/IceWhaleTech/CasaOS-Common/utils/http"
"github.com/IceWhaleTech/CasaOS/common"
"github.com/IceWhaleTech/CasaOS/pkg/cache"
"github.com/IceWhaleTech/CasaOS/pkg/config"
"github.com/IceWhaleTech/CasaOS/pkg/sqlite"
loger2 "github.com/IceWhaleTech/CasaOS/pkg/utils/loger"
"github.com/IceWhaleTech/CasaOS/pkg/utils/file"
"github.com/IceWhaleTech/CasaOS/route"
"github.com/IceWhaleTech/CasaOS/service"
"github.com/gin-gonic/gin"
"github.com/robfig/cron"
"github.com/coreos/go-systemd/daemon"
"go.uber.org/zap"
"github.com/robfig/cron/v3"
"gorm.io/gorm"
"net/http"
"time"
)
const LOCALHOST = "127.0.0.1"
var sqliteDB *gorm.DB
var swagHandler gin.HandlerFunc
var configFlag = flag.String("c", "", "config address")
var (
commit = "private build"
date = "private build"
//go:embed api/index.html
_docHTML string
//go:embed api/casaos/openapi.yaml
_docYAML string
//go:embed build/sysroot/etc/casaos/casaos.conf.sample
_confSample string
configFlag = flag.String("c", "", "config address")
dbFlag = flag.String("db", "", "db path")
versionFlag = flag.Bool("v", false, "version")
)
func init() {
flag.Parse()
config.InitSetup(*configFlag)
loger2.LogSetup()
sqliteDB = sqlite.GetDb(config.AppInfo.ProjectPath)
//gredis.GetRedisConn(config.RedisInfo),
service.MyService = service.NewService(sqliteDB, loger2.NewOLoger())
if *versionFlag {
fmt.Println("v" + common.VERSION)
return
}
println("git commit:", commit)
println("build date:", date)
config.InitSetup(*configFlag, _confSample)
logger.LogInit(config.AppInfo.LogPath, config.AppInfo.LogSaveName, config.AppInfo.LogFileExt)
if len(*dbFlag) == 0 {
*dbFlag = config.AppInfo.DBPath + "/db"
}
sqliteDB = sqlite.GetDb(*dbFlag)
// gredis.GetRedisConn(config.RedisInfo),
service.MyService = service.NewService(sqliteDB, config.CommonInfo.RuntimePath)
service.Cache = cache.Init()
service.GetCPUThermalZone()
route.InitFunction()
//service.MyService.System().GenreateSystemEntry()
///
//service.MountLists = make(map[string]*mountlib.MountPoint)
//configfile.Install()
}
// @title Oasis API
// @title casaOS API
// @version 1.0.0
// @contact.name lauren.pan
// @contact.url https://www.zimaboard.com
// @contact.email lauren.pan@icewhale.org
// @description Oasis v1版本api
// @host 192.168.2.114:8089
// @description casaOS v1版本api
// @host 192.168.2.217:8089
// @securityDefinitions.apikey ApiKeyAuth
// @in header
// @name Authorization
// @BasePath /v1
func main() {
//model.Setup()
//gredis.Setup()
r := route.InitRouter(swagHandler)
//service.SyncTask(sqliteDB)
cron2 := cron.New() //创建一个cron实例
//执行定时任务每5秒执行一次
err := cron2.AddFunc("0 0 0 1/1 * *", func() {
//service.UpdataDDNSList(mysqldb)
//service.SyncTask(sqliteDB)
})
if *versionFlag {
return
}
v1Router := route.InitV1Router()
v2Router := route.InitV2Router()
v2DocRouter := route.InitV2DocRouter(_docHTML, _docYAML)
v3File := route.InitFile()
mux := &util_http.HandlerMultiplexer{
HandlerMap: map[string]http.Handler{
"v1": v1Router,
"v2": v2Router,
"v3": v3File,
"doc": v2DocRouter,
},
}
crontab := cron.New(cron.WithSeconds())
if _, err := crontab.AddFunc("@every 5s", route.SendAllHardwareStatusBySocket); err != nil {
logger.Error("add crontab error", zap.Error(err))
}
crontab.Start()
defer crontab.Stop()
listener, err := net.Listen("tcp", net.JoinHostPort(LOCALHOST, "0"))
if err != nil {
fmt.Println(err)
panic(err)
}
routers := []string{
"/v1/sys",
"/v1/port",
"/v1/file",
"/v1/folder",
"/v1/batch",
"/v1/image",
"/v1/samba",
"/v1/notify",
"/v1/driver",
"/v1/cloud",
"/v1/recover",
"/v1/other",
"/v1/zt",
"/v1/test",
route.V2APIPath,
route.V2DocPath,
route.V3FilePath,
}
for _, apiPath := range routers {
err = service.MyService.Gateway().CreateRoute(&model.Route{
Path: apiPath,
Target: "http://" + listener.Addr().String(),
})
if err != nil {
fmt.Println("err", err)
panic(err)
}
}
//启动/关闭
cron2.Start()
defer cron2.Stop()
// register at message bus
for i := 0; i < 10; i++ {
response, err := service.MyService.MessageBus().RegisterEventTypesWithResponse(context.Background(), common.EventTypes)
if err != nil {
logger.Error("error when trying to register one or more event types - some event type will not be discoverable", zap.Error(err))
}
if response != nil && response.StatusCode() != http.StatusOK {
logger.Error("error when trying to register one or more event types - some event type will not be discoverable", zap.String("status", response.Status()), zap.String("body", string(response.Body)))
}
if response.StatusCode() == http.StatusOK {
break
}
time.Sleep(time.Second)
}
go func() {
time.Sleep(time.Second * 2)
// v0.3.6
if config.ServerInfo.HttpPort != "" {
changePort := model.ChangePortRequest{}
changePort.Port = config.ServerInfo.HttpPort
err := service.MyService.Gateway().ChangePort(&changePort)
if err == nil {
config.Cfg.Section("server").Key("HttpPort").SetValue("")
config.Cfg.SaveTo(config.SystemConfigInfo.ConfigPath)
}
}
}()
urlFilePath := filepath.Join(config.CommonInfo.RuntimePath, "casaos.url")
if err := file.CreateFileAndWriteContent(urlFilePath, "http://"+listener.Addr().String()); err != nil {
logger.Error("error when creating address file", zap.Error(err),
zap.Any("address", listener.Addr().String()),
zap.Any("filepath", urlFilePath),
)
}
// run any script that needs to be executed
scriptDirectory := filepath.Join(constants.DefaultConfigPath, "start.d")
command.ExecuteScripts(scriptDirectory)
if supported, err := daemon.SdNotify(false, daemon.SdNotifyReady); err != nil {
logger.Error("Failed to notify systemd that casaos main service is ready", zap.Any("error", err))
} else if supported {
logger.Info("Notified systemd that casaos main service is ready")
} else {
logger.Info("This process is not running as a systemd service.")
}
// http.HandleFunc("/v1/file/test", func(w http.ResponseWriter, r *http.Request) {
// //http.ServeFile(w, r, r.URL.Path[1:])
// http.ServeFile(w, r, "/DATA/test.img")
// })
// go http.ListenAndServe(":8081", nil)
s := &http.Server{
Addr: fmt.Sprintf(":%v", config.ServerInfo.HttpPort),
Handler: r,
ReadTimeout: 60 * time.Second,
WriteTimeout: 60 * time.Second,
MaxHeaderBytes: 1 << 20,
Handler: mux,
ReadHeaderTimeout: 5 * time.Second, // fix G112: Potential slowloris attack (see https://github.com/securego/gosec)
}
s.ListenAndServe()
logger.Info("CasaOS main service is listening...", zap.Any("address", listener.Addr().String()))
// defer service.MyService.Storage().UnmountAllStorage()
err = s.Serve(listener) // not using http.serve() to fix G114: Use of net/http serve function that has no support for setting timeouts (see https://github.com/securego/gosec)
if err != nil {
panic(err)
}
}

View File

@ -1,43 +0,0 @@
package middleware
import (
"fmt"
"github.com/gin-gonic/gin"
"net/http"
)
func Cors() gin.HandlerFunc {
return func(c *gin.Context) {
method := c.Request.Method
//origin := c.Request.Header.Get("Origin") //请求头部
//if origin != "" {
//接收客户端发送的origin (重要!)
c.Writer.Header().Set("Access-Control-Allow-Origin", "*")
c.Header("Access-Control-Allow-Origin", "*")
//服务器支持的所有跨域请求的方法
c.Header("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE,UPDATE")
//允许跨域设置可以返回其他子段,可以自定义字段
c.Header("Access-Control-Allow-Headers", "Authorization, Content-Length, X-CSRF-Token, Token,session")
// 允许浏览器(客户端)可以解析的头部 (重要)
c.Header("Access-Control-Expose-Headers", "Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers")
//设置缓存时间
c.Header("Access-Control-Max-Age", "172800")
//允许客户端传递校验信息比如 cookie (重要)
c.Header("Access-Control-Allow-Credentials", "true")
c.Set("content-type", "application/json")
//}
//允许类型校验
if method == "OPTIONS" {
c.JSON(http.StatusOK, "ok!")
}
defer func() {
if err := recover(); err != nil {
fmt.Println(err)
}
}()
c.Next()
}
}

View File

@ -1,100 +0,0 @@
package model
import (
"database/sql/driver"
"encoding/json"
"time"
)
type ServerAppList struct {
Id uint `gorm:"column:id;primary_key" json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Tagline string `json:"tagline"`
Tags Strings `gorm:"type:json" json:"tags"`
Icon string `json:"icon"`
ScreenshotLink Strings `gorm:"type:json" json:"screenshot_link"`
Category string `json:"category"`
TcpPort uint `json:"tcp_port"`
PortMap uint `json:"port_map"`
ImageVersion string `json:"image_version"`
Tip string `json:"tip"`
Configures configures `gorm:"type:json" json:"configures"`
NetworkModel string `json:"network_mode"`
Image string `json:"image"`
Index string `json:"index"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
State string `json:"state"`
Author string `json:"author"`
MinMemory int `json:"min_memory"`
MinDisk int `json:"min_disk"`
MaxMemory uint64 `json:"max_memory"`
Thumbnail string `json:"thumbnail"`
Healthy string `json:"healthy"`
Plugins Strings `json:"plugins"`
}
type Ports struct {
ContainerPort uint `json:"container_port"`
CommendPort int `json:"commend_port"`
Desc string `json:"desc"`
Type int `json:"type"` // 1:必选 2:可选 3:默认值不必显示 4:系统处理 5:container内容也可编辑
}
type Volume struct {
ContainerPath string `json:"container_path"`
Path string `json:"path"`
Desc string `json:"desc"`
Type int `json:"type"` // 1:必选 2:可选 3:默认值不必显示 4:系统处理 5:container内容也可编辑
}
type Envs struct {
Name string `json:"name"`
Value string `json:"value"`
Desc string `json:"desc"`
Type int `json:"type"` // 1:必选 2:可选 3:默认值不必显示 4:系统处理 5:container内容也可编辑
}
type Devices struct {
ContainerPath string `json:"container_path"`
Path string `json:"path"`
Desc string `json:"desc"`
Type int `json:"type"` // 1:必选 2:可选 3:默认值不必显示 4:系统处理 5:container内容也可编辑
}
type configures struct {
TcpPorts []Ports `json:"tcp_ports"`
UdpPorts []Ports `json:"udp_ports"`
Envs []Envs `json:"envs"`
Volumes []Volume `json:"volumes"`
Devices []Devices `json:"devices"`
}
/****************使gorm支持[]string结构*******************/
type Strings []string
func (c Strings) Value() (driver.Value, error) {
b, err := json.Marshal(c)
return string(b), err
}
func (c *Strings) Scan(input interface{}) error {
return json.Unmarshal(input.([]byte), c)
}
/****************使gorm支持[]string结构*******************/
/****************使gorm支持[]string结构*******************/
type MapStrings []map[string]string
func (c MapStrings) Value() (driver.Value, error) {
b, err := json.Marshal(c)
return string(b), err
}
func (c *MapStrings) Scan(input interface{}) error {
return json.Unmarshal(input.([]byte), c)
}
/****************使gorm支持[]string结构*******************/

39
model/args.go Normal file
View File

@ -0,0 +1,39 @@
package model
import (
"io"
"net/http"
"time"
)
type ListArgs struct {
ReqPath string
}
type LinkArgs struct {
IP string
Header http.Header
Type string
}
type Link struct {
URL string `json:"url"`
Header http.Header `json:"header"` // needed header
Data io.ReadCloser // return file reader directly
Status int // status maybe 200 or 206, etc
FilePath *string // local file, return the filepath
Expiration *time.Duration // url expiration time
Method string `json:"method"` // http method
}
type OtherArgs struct {
Obj Obj
Method string
Data interface{}
}
type FsOtherArgs struct {
Path string `json:"path" form:"path"`
Method string `json:"method" form:"method"`
Data interface{} `json:"data" form:"data"`
}

View File

@ -1,10 +0,0 @@
package model
type ServerCategoryList struct {
Id uint `gorm:"column:id;primary_key" json:"id"`
//CreatedAt time.Time `json:"created_at"`
//
//UpdatedAt time.Time `json:"updated_at"`
Name string `json:"name"`
Count uint `json:"count"`
}

6
model/common.go Normal file
View File

@ -0,0 +1,6 @@
package model
type PageResp struct {
Content interface{} `json:"content"`
Total int64 `json:"total"`
}

20
model/connections.go Normal file
View File

@ -0,0 +1,20 @@
/*
* @Author: LinkLeong link@icewhale.org
* @Date: 2022-07-27 10:30:43
* @LastEditors: LinkLeong
* @LastEditTime: 2022-08-04 20:06:04
* @FilePath: /CasaOS/model/connections.go
* @Description:
* @Website: https://www.casaos.io
* Copyright (c) 2022 by icewhale, All Rights Reserved.
*/
package model
type Connections struct {
ID uint `json:"id"`
Username string `json:"username"`
Password string `json:"password,omitempty"`
Host string `json:"host"`
Port string `json:"port"`
MountPoint string `json:"mount_point"`
}

View File

@ -1,31 +0,0 @@
package model
type LSBLKModel struct {
Name string `json:"name"`
FsType string `json:"fstype"`
Size uint64 `json:"size"`
FSSize string `json:"fssize"`
Path string `json:"path"`
Model string `json:"model"` //设备标识符
RM bool `json:"rm"` //是否为可移动设备
RO bool `json:"ro"` //是否为只读设备
State string `json:"state"`
PhySec int `json:"phy-sec"` //物理扇区大小
Type string `json:"type"`
Vendor string `json:"vendor"` //供应商
Rev string `json:"rev"` //修订版本
FSAvail string `json:"fsavail"` //可用空间
FSUse string `json:"fsuse%"` //已用百分比
MountPoint string `json:"mountpoint"`
Format string `json:"format"`
Health string `json:"health"`
HotPlug bool `json:"hotplug"`
FSUsed string `json:"fsused"`
Tran string `json:"tran"`
MinIO uint64 `json:"min-io"`
UsedPercent float64 `json:"used_percent"`
Children []LSBLKModel `json:"children"`
//详情特有
StartSector uint64 `json:"start_sector,omitempty"`
EndSector uint64 `json:"end_sector,omitempty"`
}

7
model/drive.go Normal file
View File

@ -0,0 +1,7 @@
package model
type Drive struct {
Name string `json:"name"`
Icon string `json:"icon"`
AuthUrl string `json:"auth_url"`
}

33
model/file.go Normal file
View File

@ -0,0 +1,33 @@
/*
* @Author: LinkLeong link@icewhale.com
* @Date: 2022-05-20 16:27:12
* @LastEditors: LinkLeong
* @LastEditTime: 2022-06-09 18:18:46
* @FilePath: /CasaOS/model/file.go
* @Description:
* @Website: https://www.casaos.io
* Copyright (c) 2022 by icewhale, All Rights Reserved.
*/
package model
type FileOperate struct {
Type string `json:"type" binding:"required"`
Item []FileItem `json:"item" binding:"required"`
TotalSize int64 `json:"total_size"`
ProcessedSize int64 `json:"processed_size"`
To string `json:"to" binding:"required"`
Style string `json:"style"`
Finished bool `json:"finished"`
}
type FileItem struct {
From string `json:"from" binding:"required"`
Finished bool `json:"finished"`
Size int64 `json:"size"`
ProcessedSize int64 `json:"processed_size"`
}
type FileUpdate struct {
FilePath string `json:"path" binding:"required"`
FileContent string `json:"content" binding:"required"`
}

6
model/heart.go Normal file
View File

@ -0,0 +1,6 @@
package model
type CasaOSHeart struct {
UuId string `json:"uuid"`
Type string `json:"type"`
}

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