Skip to content

Commit 6d88096

Browse files
committed
Updates v1.119
+ Added fuzzy search in File Manager + Added localization on trashbin, share page and default opener page + Rewrite Photo Module (WIP) + Added neural network models for image AGI API + Fixed scheduler log filename + Fixed audio testing interface scrollbar overflow issue + Added 404 and 500 page + Updated embedded photo viewer with zoom and print function + Added OTA Update functions (Launcher only) + Updated URL shortcut icon + Added new Memo module + Added WebApp hot reload functions + Fixed websocket upgrader to accept CORS * header + Added MAC addr broadcast in mDNS + Moved PDF viewer to utilities group + Fixing issues related to Share Drive + Fixed storage pool editor GUI + Updated desktop filename display segmentation method and algorithms - Fixed pending: Commit yolo3 weight to github
1 parent 95c07b4 commit 6d88096

File tree

949 files changed

+53095
-872
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

949 files changed

+53095
-872
lines changed

installer/install_for_pi.sh

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/bin/bash
2+
3+
# Automatic install script for ArozOS - by tobychui
4+
# For internal use only, All Right Reserved
5+
echo "[ArozOS Installer]"
6+
echo "Updating apt"
7+
sudo apt upgrade -y
8+
sudo apt-get update -y
9+
sudo apt-get install ffmpeg samba git net-tools -y
10+
11+
echo "Cloning ArozOS from source"
12+
git clone https://github.com/tobychui/arozos
13+
14+
echo "Installing Golang"
15+
arch=$(uname -m)
16+
gover="1.17.6"
17+
if [[ $arch == x86_64* ]]; then
18+
echo "Selecting x64 Architecture"
19+
wget https://golang.org/dl/go$gover.linux-amd64.tar.gz
20+
elif [[ $arch == arm* ]]; then
21+
echo "Selecting ARM Architecture"
22+
wget https://golang.org/dl/go$gover.linux-armv6l.tar.gz
23+
elif [[ $arch == "aarch64" ]]; then
24+
echo "Selecting ARM64 Architecture"
25+
wget https://golang.org/dl/go$gover.linux-arm64.tar.gz
26+
elif [[ $arch == "unknown" ]]; then
27+
echo "Unknown CPU arch. Please enter CPU architecture manually (arm/arm64/amd64)"
28+
read -p "Architecture: " arch
29+
if [ "$arch" = "arm" ]; then
30+
echo "Installing arm version of go"
31+
wget https://golang.org/dl/go$gover.linux-armv6l.tar.gz
32+
fi
33+
if [ "$arch" = "arm64" ]; then
34+
echo "Installing arm64 version of go"
35+
wget https://golang.org/dl/go$gover.linux-arm64.tar.gz
36+
fi
37+
38+
if [ "$arch" = "amd64" ]; then
39+
echo "Installing amd64 version of go"
40+
wget https://golang.org/dl/go$gover.linux-amd64.tar.gz
41+
fi
42+
fi
43+
sudo tar -C /usr/local -xzf go*
44+
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
45+
PATH=$PATH:/usr/local/go/bin
46+
47+
echo "Building ArozOS"
48+
cd arozos
49+
sudo chmod 777 -R ./
50+
cd src
51+
go mod tidy
52+
go build
53+
54+
echo "Setting up system services"
55+
sudo systemctl enable systemd-networkd.service systemd-networkd-wait-online.service
56+
cd /etc/systemd/system/
57+
58+
printf "[Unit]\nDescription=ArozOS Cloud Service\nAfter=systemd-networkd-wait-online.service\nWants=systemd-networkd-wait-online.service\n\n[Service]\nType=simple\nExecStartPre=/bin/sleep 10\nWorkingDirectory=/home/pi/arozos/src/\nExecStart=/bin/bash /home/pi/arozos/src/start.sh\n\nRestart=always\nRestartSec=10\n\n[Install]\nWantedBy=multi-user.target" | sudo tee -a ./arozos.service
59+
60+
echo "Registering systemctl service"
61+
sudo systemctl start arozos.service
62+
63+
echo "Starting arozos"
64+
sudo systemctl enable arozos.service
65+
66+
thisip=$(hostname -I | cut -d' ' -f1)
67+
echo "Installation completed. Visit ArozOS web UI with http://$thisip:8080"

src/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ tmp/*
1010
files/users*
1111
__debug_bin
1212
experimentals/*
13+
updates/*
1314

1415
#Database related
1516
*.db
@@ -29,6 +30,7 @@ system/storage.json
2930
system/bridge.json
3031
system/storage/*.json
3132
system/cron.json
33+
system/neuralnet/predictions.jpg
3234

3335
#Logs related
3436
system/aecron/*.log
@@ -62,3 +64,4 @@ upx.exe
6264
start.sh.backup
6365
*.backup
6466
system/bridge.json
67+
launcher.exe

src/AGI Documentation.md

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@ one of these functions has to be called.
215215
```
216216
sendResp(string) => Response header with text/plain header
217217
sendJSONResp(json_string) => Response request with JSON header
218+
219+
//Since v1.119
220+
sendJSONResp(object) => Overload function, allow the same API to send Javascript object directly without the need for manual stringify using JSON.stringify
218221
```
219222

220223
Customize header:
@@ -455,6 +458,7 @@ For glob and aglob, developer can pass in the following sorting modes (case sens
455458
- largeToSmall
456459
- mostRecent
457460
- leastRecent
461+
- smart (Added in v1.119, AGI only, for sorting filename containing digits with no zero pads)
458462

459463
```
460464
//Example for sorting the desktop files to largeToSmall
@@ -502,7 +506,14 @@ imagelib.getImageDimension("user:/Desktop/test.jpg"); //return [width,
502506
imagelib.resizeImage("user:/Desktop/input.png", "user:/Desktop/output.png", 500, 300); //Resize input.png to 500 x 300 pixal and write to output.png
503507
imagelib.loadThumbString("user:/Desktop/test.jpg"); //Load the given file's thumbnail as base64 string, return false if failed
504508
imagelib.cropImage("user:/Desktop/test.jpg", "user:/Desktop/out.jpg",100,100,200,200));
505-
/*
509+
//Classify an image using neural network, since v1.119
510+
imagelib.classify("tmp:/classify.jpg", "yolo3");
511+
512+
```
513+
514+
#### Crop Image Options
515+
516+
```
506517
Crop the given image with the following arguemnts:
507518
508519
1) Input file (virtual path)
@@ -513,12 +524,50 @@ Crop the given image with the following arguemnts:
513524
6) Crop Height
514525
515526
return true if success, false if failed
516-
*/
527+
```
528+
529+
517530

531+
#### AI Classifier Options (since v1.119)
532+
533+
**ImageLib AI Classifier requires darknet to operate normally. If your ArozOS is a trim down version or using a host architecture that ArozOS did not ship with a valid darknet binary executable in ```system/neuralnet/``` folder, this will always return```false```.**
534+
535+
```
536+
Classify allow the following classifier options
518537
538+
1) default / darknet19
539+
2) yolo3
519540
```
520541

542+
The output of the classifier will output the followings
543+
544+
```
545+
Name (string, the name of object detected)
546+
Percentage (float, the confidence of detection)
547+
Positions (integer array, the pixel location of the detected object in left, top, width, height sequence)
548+
```
549+
550+
Here is an example code for parsing the output, or you can also directly throw it into the JSON stringify and process it on frontend
551+
552+
```javascript
553+
var results = imagelib.classify("tmp:/classify.jpg");
554+
var responses = [];
555+
for (var i = 0; i < results.length; i++){
556+
responses.push({
557+
"object": results[i].Name,
558+
"confidence": results[i].Percentage,
559+
"position_x": results[i].Positions[0],
560+
"position_y": results[i].Positions[1],
561+
"width": results[i].Positions[2],
562+
"height": results[i].Positions[3]
563+
});
564+
}
565+
```
566+
567+
568+
521569
### http
570+
522571
A basic http function group that allow GET / POST / HEAD / Download request to other web resources
523572

524573
```

src/agi.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ func AGIInit() {
1717
BuildVersion: build_version,
1818
InternalVersion: internal_version,
1919
LoadedModule: moduleHandler.GetModuleNameList(),
20-
ReservedTables: []string{"auth", "permisson", "desktop"},
21-
ModuleRegisterParser: moduleHandler.RegisterModuleFromJSON,
20+
ReservedTables: []string{"auth", "permisson", "register", "desktop"},
21+
ModuleRegisterParser: moduleHandler.RegisterModuleFromAGI,
2222
PackageManager: packageManager,
2323
UserHandler: userHandler,
2424
StartupRoot: "./web",
2525
ActivateScope: []string{"./web", "./subservice"},
2626
FileSystemRender: thumbRenderHandler,
2727
ShareManager: shareManager,
28+
NightlyManager: nightlyManager,
2829
})
2930
if err != nil {
3031
log.Println("AGI Gateway Initialization Failed")
@@ -70,5 +71,7 @@ func AGIInit() {
7071

7172
})
7273

74+
http.HandleFunc("/api/ajgi/exec", gw.HandleAgiExecutionRequestWithToken)
75+
7376
AGIGateway = gw
7477
}

src/autopush.bat

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@echo off
2+
set /p id="Enter commit notes: "
3+
git pull
4+
git add -A
5+
git commit -m "%id%"
6+
git push

src/autopush.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
echo Enter commit notes:
3+
read commitmsg
4+
git pull
5+
git add *
6+
git commit -m "$commitmsg"
7+
git push

src/autorelease.bat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@echo off
2+
set /p id="Enter a release version (e.g. v0.0.1) :"
3+
git tag "%id%"
4+
git push origin "%id%"

src/build.sh

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# /bin/sh
2+
echo "Building darwin"
3+
#GOOS=darwin GOARCH=386 go build
4+
#mv aroz_online build/aroz_online_macOS_i386
5+
GOOS=darwin GOARCH=amd64 go build
6+
mv arozos ../aroz_online_autorelease/arozos_darwin_amd64
7+
8+
echo "Building linux"
9+
#GOOS=linux GOARCH=386 go build
10+
#mv aroz_online build/aroz_online_linux_i386
11+
GOOS=linux GOARCH=amd64 go build
12+
mv arozos ../aroz_online_autorelease/arozos_linux_amd64
13+
GOOS=linux GOARCH=arm GOARM=6 go build
14+
mv arozos ../aroz_online_autorelease/arozos_linux_arm
15+
GOOS=linux GOARCH=arm GOARM=7 go build
16+
mv arozos ../aroz_online_autorelease/arozos_linux_armv7
17+
GOOS=linux GOARCH=arm64 go build
18+
mv arozos ../aroz_online_autorelease/arozos_linux_arm64
19+
20+
#Currently not CGO is required to build arozos. May remove dependencies later in the future
21+
echo "Building OpenWRT"
22+
GOOS=linux GOARCH=mipsle GOMIPS=softfloat CGO_ENABLED=0 go build
23+
mv arozos ../aroz_online_autorelease/arozos_linux_mipsle
24+
25+
echo "Building windows"
26+
#GOOS=windows GOARCH=386 go build
27+
#mv aroz_online.exe aroz_online_windows_i386.exe
28+
GOOS=windows GOARCH=amd64 go build
29+
mv arozos.exe ../aroz_online_autorelease/arozos_windows_amd64.exe
30+
31+
echo "Removing old build resources"
32+
rm -rf ../aroz_online_autorelease/web/
33+
rm -rf ../aroz_online_autorelease/system/
34+
#rm -rf ../aroz_online_autorelease/subservice/
35+
36+
echo "Moving subfolders to build folder"
37+
cp -r ./web ../aroz_online_autorelease/web/
38+
#cp -r ./subservice ../aroz_online_autorelease/subservice/
39+
cp -r ./system ../aroz_online_autorelease/system/
40+
41+
rm ../aroz_online_autorelease/system/dev.uuid
42+
rm ../aroz_online_autorelease/system/ao.db
43+
mv ../aroz_online_autorelease/system/storage.json ../aroz_online_autorelease/system/storage.json.example
44+
rm -rf ../aroz_online_autorelease/system/aecron/
45+
rm ../aroz_online_autorelease/system/cron.json
46+
rm ../aroz_online_autorelease/system/bridge.json
47+
rm ../aroz_online_autorelease/system/auth/authlog.db
48+
49+
#Remove modules that should not go into the build folder
50+
rm -rf "../aroz_online_autorelease/web/Cyinput"
51+
rm -rf "../aroz_online_autorelease/system/Label Maker"
52+
53+
54+
echo "Creating tarball for all required files"
55+
cd ../aroz_online_autorelease/
56+
rm web.tar.gz
57+
tar -czf web.tar.gz system/ web/
58+
59+
cd ../arozos/
60+
go build
61+
echo "Completed"

src/buildFullErrorList.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
go build -gcflags="-e" >out.txt 2>&1

src/build_binary-only.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# /bin/sh
2+
echo "Building darwin"
3+
#GOOS=darwin GOARCH=386 go build
4+
#mv aroz_online build/aroz_online_macOS_i386
5+
GOOS=darwin GOARCH=amd64 go build
6+
mv arozos ../aroz_online_autorelease/arozos_darwin_amd64
7+
8+
echo "Building linux"
9+
#GOOS=linux GOARCH=386 go build
10+
#mv aroz_online build/aroz_online_linux_i386
11+
GOOS=linux GOARCH=amd64 go build
12+
mv arozos ../aroz_online_autorelease/arozos_linux_amd64
13+
GOOS=linux GOARCH=arm GOARM=6 go build
14+
mv arozos ../aroz_online_autorelease/arozos_linux_arm
15+
GOOS=linux GOARCH=arm GOARM=7 go build
16+
mv arozos ../aroz_online_autorelease/arozos_linux_armv7
17+
GOOS=linux GOARCH=arm64 go build
18+
mv arozos ../aroz_online_autorelease/arozos_linux_arm64
19+
20+
echo "Building windows"
21+
#GOOS=windows GOARCH=386 go build
22+
#mv aroz_online.exe aroz_online_windows_i386.exe
23+
GOOS=windows GOARCH=amd64 go build
24+
mv arozos.exe ../aroz_online_autorelease/arozos_windows_amd64.exe
25+
26+
echo "Completed"

0 commit comments

Comments
 (0)