Added Stirling-PDF
This commit is contained in:
1 parent
ceb19235d5
commit
230a360ad7
7 files changed
+130
No files matched your search
@@ -0,0 +1,27 @@
|
|||||||
|
# The `upstream` directives ensure that you have a http/1.1 connection
|
||||||
|
# This enables the keepalive option and better performance
|
||||||
|
#
|
||||||
|
# Define the server IP and ports here.
|
||||||
|
upstream server {
|
||||||
|
server localhost:{{ host_port }};
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
|
||||||
|
listen 80;
|
||||||
|
server_name {{ http_host }};
|
||||||
|
|
||||||
|
# Allow large attachments
|
||||||
|
client_max_body_size 525M;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
|
||||||
|
proxy_pass http://server;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Executable
+12
@@ -0,0 +1,12 @@
|
|||||||
|
#################################################
|
||||||
|
# Bitwarden Playbook
|
||||||
|
#################################################
|
||||||
|
---
|
||||||
|
- hosts: gondor
|
||||||
|
become: true
|
||||||
|
vars_files:
|
||||||
|
- vars/default.yml
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- stirling
|
||||||
|
- nginx
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
This 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.
|
||||||
|
|
||||||
|
https://github.com/Stirling-Tools/Stirling-PDF
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
# Handlers for Nginx role
|
||||||
|
- name: Reload Nginx
|
||||||
|
service:
|
||||||
|
name: nginx
|
||||||
|
state: reloaded
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
# Tasks for Nginx role
|
||||||
|
- name: Check if Nginx conf file exists
|
||||||
|
stat:
|
||||||
|
path: "/etc/nginx/sites-available/{{ http_conf }}"
|
||||||
|
register: status
|
||||||
|
|
||||||
|
- name: No need to reload Nginx
|
||||||
|
debug:
|
||||||
|
msg: "No need to reload Nginx as sites-available entries have already been created"
|
||||||
|
|
||||||
|
- name: Set Nginx conf file
|
||||||
|
when: status.stat.exists == false
|
||||||
|
template:
|
||||||
|
src: "files/nginx.conf.j2"
|
||||||
|
dest: "/etc/nginx/sites-available/{{ http_conf }}"
|
||||||
|
|
||||||
|
- name: Enable new site
|
||||||
|
when: status.stat.exists == false
|
||||||
|
file:
|
||||||
|
src: "/etc/nginx/sites-available/{{ http_conf }}"
|
||||||
|
dest: "/etc/nginx/sites-enabled/{{ http_conf }}"
|
||||||
|
state: link
|
||||||
|
notify: Reload Nginx
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
---
|
||||||
|
# Tasks for Stirling-PDF role
|
||||||
|
- name: Pull Stirling-PDF image
|
||||||
|
docker_image:
|
||||||
|
name: "{{ image }}"
|
||||||
|
source: pull
|
||||||
|
force_source: yes
|
||||||
|
|
||||||
|
- name: Ensure Stirling-PDF Directory exists
|
||||||
|
file:
|
||||||
|
path: "/var/lib/{{ host_directory }}"
|
||||||
|
state: directory
|
||||||
|
mode: 0755
|
||||||
|
|
||||||
|
- name: Ensure Directory for the tesseract ocr training data exists
|
||||||
|
file:
|
||||||
|
path: "/var/lib/{{ host_directory }}/training-data"
|
||||||
|
state: directory
|
||||||
|
mode: 0755
|
||||||
|
|
||||||
|
- name: Check if tesseract ocr training data exists
|
||||||
|
stat:
|
||||||
|
path: "/var/lib/{{ host_directory }}/training-data/eng.traineddata"
|
||||||
|
register: traineddata
|
||||||
|
|
||||||
|
- name: Download eng.traineddata
|
||||||
|
get_url:
|
||||||
|
url: "https://github.com/tesseract-ocr/tessdata/raw/main/eng.traineddata"
|
||||||
|
dest: "/var/lib/{{ host_directory }}/training-data/eng.traineddata"
|
||||||
|
mode: '0644'
|
||||||
|
when: not traineddata.stat.exists
|
||||||
|
|
||||||
|
- name: Create Stirling-PDF container
|
||||||
|
docker_container:
|
||||||
|
name: "{{ container }}"
|
||||||
|
image: "{{ image }}"
|
||||||
|
state: started
|
||||||
|
restart_policy: "unless-stopped"
|
||||||
|
env:
|
||||||
|
DOCKER_ENABLE_SECURITY: "false"
|
||||||
|
INSTALL_BOOK_AND_ADVANCED_HTML_OPS: "false"
|
||||||
|
LANGS: en_GB
|
||||||
|
published_ports:
|
||||||
|
- "127.0.0.1:{{ host_port }}:8080"
|
||||||
|
volumes:
|
||||||
|
- "/var/lib/{{ host_directory }}/training-data:/usr/share/tessdata"
|
||||||
|
- "/var/lib/{{ host_directory }}/extra-configs:/configs"
|
||||||
|
- "/var/lib/{{ host_directory }}/logs:/logs"
|
||||||
|
- "/var/lib/{{ host_directory }}/custom-files:/customFiles"
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
http_host: "pdf.tanshu.com"
|
||||||
|
http_conf: "pdf.tanshu.com.conf"
|
||||||
|
|
||||||
|
container: stirling-pdf
|
||||||
|
image: frooodle/s-pdf:latest
|
||||||
|
|
||||||
|
host_directory: stirling-pdf
|
||||||
|
host_port: 8002
|
||||||
Reference in new issue
Block a user