-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from vgarcia007/custom01
Upgrade web interface and Dockerfile
- Loading branch information
Showing
41 changed files
with
10,003 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
docker-compose.yml | ||
.vscode | ||
!.vscode/launch.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.PHONY: brotherscanner update-container | ||
|
||
build: brotherscanner | ||
|
||
brotherscanner: | ||
docker build --no-cache -t brotherscanner -f Dockerfile . | ||
|
||
update-container: | ||
./update-container.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
version: '3' | ||
|
||
services: | ||
brother-scanner: | ||
image: ghcr.io/philippmundhenk/brotherscannerdocker | ||
volumes: | ||
- /path/on/host:/scans | ||
ports: | ||
- 33355:33355 | ||
- 54925:54925/udp # mandatory, for scanner tools | ||
- 54921:54921 # mandatory, for scanner tools | ||
- 161:161/udp # mandatory, for scanner tools | ||
environment: | ||
- NAME=Scanner | ||
- MODEL=MFC-L2700DW | ||
- IPADDRESS=192.168.188.133 # scanner IP address | ||
- UID=1000 # note: network mount needs to have correct permissions! | ||
- GID=1000 # note: network mount needs to have correct permissions! | ||
- TZ=Europe/Berlin | ||
- HOST_IPADDRESS=192.168.188.117 | ||
- WEBSERVER=true | ||
- RENAME_GUI_SCANTOFILE="Scan front pages" | ||
- RENAME_GUI_SCANTOEMAIL="Scan rear pages" | ||
- DISABLE_GUI_SCANTOOCR=true | ||
- DISABLE_GUI_SCANTOIMAGE=true | ||
- OCR_SERVER=192.168.188.117 | ||
- OCR_PORT=3217 | ||
- OCR_PATH=ocr.php | ||
- TELEGRAM_TOKEN="" # note: keep the word bot in the string | ||
- TELEGRAM_CHATID=127585497 # note: target chat id. can be person or group | ||
restart: unless-stopped | ||
|
||
# optional, for OCR | ||
ocr: | ||
image: ghcr.io/philippmundhenk/tesseractocrmicroservice | ||
restart: unless-stopped | ||
ports: | ||
- 3217:80 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
function isProcessRunning($processName) { | ||
// Execute the pgrep command | ||
$command = "pgrep $processName"; | ||
exec($command, $output, $status); | ||
|
||
// Check if pgrep returned a status of 0, which means the process was found | ||
if ($status === 0) { | ||
// Process is running | ||
return true; | ||
} else { | ||
// Process is not running | ||
return false; | ||
} | ||
} | ||
|
||
// Check if the scanimage, sleep, and curl processes are running | ||
$result = array( | ||
'scan' => isProcessRunning('scanimage'), | ||
'waiting' => isProcessRunning('sleep'), | ||
'ocr' => isProcessRunning('curl') | ||
); | ||
|
||
|
||
// Output the result as JSON | ||
header('Content-Type: application/json; charset=utf-8'); | ||
echo json_encode($result); | ||
|
||
?> |
Oops, something went wrong.