-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d4c480
commit 3f9fc8c
Showing
6 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
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,15 @@ | ||
=== "Access to the web interface" | ||
|
||
The web interface is accessible via port **8077**: | ||
|
||
- URL: `https://<your.IP>:8077` | ||
|
||
=== "Directories" | ||
|
||
- Install directory: `/armbian/stirling` | ||
|
||
=== "View logs" | ||
|
||
```sh | ||
docker logs -f stirling-pdf | ||
``` |
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 @@ | ||
Stirling-PDF is a robust, locally hosted web-based PDF manipulation tool using Docker. It enables you to carry out various operations on PDF files, including splitting, merging, converting, reorganizing, adding images, rotating, compressing, and more. This locally hosted web application has evolved to encompass a comprehensive set of features, addressing all your PDF requirements. |
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
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,85 @@ | ||
module_options+=( | ||
["module_stirling,author"]="@Frooodle" | ||
["module_stirling,maintainer"]="@armbian @igorpecovnik" | ||
["module_stirling,testers"]="@igorpecovnik" | ||
["module_stirling,feature"]="module_stirling" | ||
["module_stirling,desc"]="Install stirling container" | ||
["module_stirling,example"]="install remove purge status help" | ||
["module_stirling,port"]="8077" | ||
["module_stirling,status"]="Active" | ||
["module_stirling,arch"]="" | ||
) | ||
# | ||
# Module stirling-PDF | ||
# | ||
function module_stirling () { | ||
local title="stirling" | ||
local condition=$(which "$title" 2>/dev/null) | ||
|
||
if check_if_installed docker-ce; then | ||
local container=$(docker container ls -a | mawk '/stirling-pdf?( |$)/{print $1}') | ||
local image=$(docker image ls -a | mawk '/stirling-pdf?( |$)/{print $3}') | ||
fi | ||
|
||
local commands | ||
IFS=' ' read -r -a commands <<< "${module_options["module_stirling,example"]}" | ||
|
||
STIRLING_BASE="${SOFTWARE_FOLDER}/stirling" | ||
|
||
case "$1" in | ||
"${commands[0]}") | ||
check_if_installed docker-ce || install_docker | ||
[[ -d "$STIRLING_BASE" ]] || mkdir -p "$STIRLING_BASE" || { echo "Couldn't create storage directory: $STIRLING_BASE"; exit 1; } | ||
docker run -d \ | ||
-p 8077:8080 \ | ||
-v "${STIRLING_BASE}/trainingData:/usr/share/tessdata" \ | ||
-v "${STIRLING_BASE}/extraConfigs:/configs" \ | ||
-v "${STIRLING_BASE}/logs:/logs" \ | ||
-v "${STIRLING_BASE}/customFiles:/customFiles" \ | ||
-e DOCKER_ENABLE_SECURITY=false \ | ||
-e INSTALL_BOOK_AND_ADVANCED_HTML_OPS=false \ | ||
-e LANGS=en_GB \ | ||
--name stirling-pdf \ | ||
stirlingtools/stirling-pdf:latest | ||
for i in $(seq 1 20); do | ||
if docker inspect -f '{{ index .Config.Labels "build_version" }}' stirling-pdf >/dev/null 2>&1 ; then | ||
break | ||
else | ||
sleep 3 | ||
fi | ||
if [ $i -eq 20 ] ; then | ||
echo -e "\nTimed out waiting for ${title} to start, consult your container logs for more info (\`docker logs stirling-pdf\`)" | ||
exit 1 | ||
fi | ||
done | ||
;; | ||
"${commands[1]}") | ||
[[ "${container}" ]] && docker container rm -f "$container" >/dev/null | ||
[[ "${image}" ]] && docker image rm "$image" >/dev/null | ||
;; | ||
"${commands[2]}") | ||
[[ -n "${STIRLING_BASE}" && "${STIRLING_BASE}" != "/" ]] && rm -rf "${STIRLING_BASE}" | ||
;; | ||
"${commands[3]}") | ||
if [[ "${container}" && "${image}" ]]; then | ||
return 0 | ||
else | ||
return 1 | ||
fi | ||
;; | ||
"${commands[4]}") | ||
echo -e "\nUsage: ${module_options["module_stirling,feature"]} <command>" | ||
echo -e "Commands: ${module_options["module_stirling,example"]}" | ||
echo "Available commands:" | ||
echo -e "\tinstall\t- Install $title." | ||
echo -e "\tremove\t- Remove $title." | ||
echo -e "\tpurge\t- Purge $title data folder." | ||
echo -e "\tstatus\t- Installation status $title." | ||
|
||
echo | ||
;; | ||
*) | ||
${module_options["module_stirling,feature"]} ${commands[4]} | ||
;; | ||
esac | ||
} |