Skip to content

Commit 7933a43

Browse files
committed
Merge branch 'main' of github.com:romkey/pdxhackerspace-hackstack
2 parents 8608372 + e529e82 commit 7933a43

7 files changed

Lines changed: 223 additions & 131 deletions

File tree

.gitignore

Lines changed: 0 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -11,141 +11,10 @@
1111

1212
*~
1313

14-
lib/**
15-
log/**
16-
run/**
17-
1814
avahi-dns/services
1915

2016
home-assistant/config/
2117

2218
redis/conf/
2319

2420
upsd/config/
25-
26-
# Patterns from dnsmasq/.gitignore
27-
dnsmasq/config/dnsmasq.conf
28-
dnsmasq/config/hosts.d/
29-
30-
# Patterns from rtlamr2mqtt/.gitignore
31-
rtlamr2mqtt/config.yaml
32-
33-
# Patterns from autogenerate-hosts/.gitignore
34-
autogenerate-hosts/.env
35-
autogenerate-hosts/app/npm-hosts
36-
37-
# Patterns from influxdb/.gitignore
38-
influxdb/config/influx-configs
39-
40-
# Patterns from zigbee2mqtt/.gitignore
41-
zigbee2mqtt/data/configuration.yaml
42-
zigbee2mqtt/data/state.json
43-
zigbee2mqtt/data/database.db
44-
zigbee2mqtt/data/log/
45-
46-
# Patterns from telegraf/.gitignore
47-
telegraf/config/telegraf.conf
48-
49-
# Patterns from wiki/.gitignore
50-
wiki/config.yml
51-
52-
# Patterns from jellyfin/.gitignore
53-
jellyfin/config/
54-
55-
# Patterns from mopidy/.gitignore
56-
mopidy/config/mopidy.conf
57-
58-
# Patterns from auto_planka/.gitignore
59-
auto_planka/*.gem
60-
auto_planka/*.rbc
61-
auto_planka//.config
62-
auto_planka//coverage/
63-
auto_planka//InstalledFiles
64-
auto_planka//pkg/
65-
auto_planka//spec/reports/
66-
auto_planka//spec/examples.txt
67-
auto_planka//test/tmp/
68-
auto_planka//test/version_tmp/
69-
auto_planka//tmp/
70-
auto_planka/
71-
auto_planka/# Used by dotenv library to load environment variables.
72-
auto_planka/.env*
73-
auto_planka/
74-
auto_planka/## Specific to RubyMotion:
75-
auto_planka/.dat*
76-
auto_planka/.repl_history
77-
auto_planka/build/
78-
auto_planka/*.bridgesupport
79-
auto_planka/build-iPhoneOS/
80-
auto_planka/build-iPhoneSimulator/
81-
auto_planka/
82-
auto_planka/## Specific to RubyMotion (use of CocoaPods):
83-
auto_planka/#
84-
auto_planka/# We recommend against adding the Pods directory to your .gitignore. However
85-
auto_planka/# you should judge for yourself, the pros and cons are mentioned at:
86-
auto_planka/# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
87-
auto_planka/#
88-
auto_planka/# vendor/Pods/
89-
auto_planka/
90-
auto_planka/## Documentation cache and generated files:
91-
auto_planka//.yardoc/
92-
auto_planka//_yardoc/
93-
auto_planka//doc/
94-
auto_planka//rdoc/
95-
auto_planka/
96-
auto_planka/## Environment normalization:
97-
auto_planka//.bundle/
98-
auto_planka//vendor/bundle
99-
auto_planka//lib/bundler/man/
100-
auto_planka/
101-
auto_planka/# for a library or gem, you might want to ignore these files since the code is
102-
auto_planka/# intended to run in multiple environments; otherwise, check them in:
103-
auto_planka/# Gemfile.lock
104-
auto_planka/# .ruby-version
105-
auto_planka/# .ruby-gemset
106-
auto_planka/
107-
auto_planka/# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
108-
auto_planka/.rvmrc
109-
auto_planka/
110-
auto_planka/*.json
111-
auto_planka/
112-
auto_planka/app/.env
113-
114-
# Patterns from backrest/.gitignore
115-
backrest/config/config.json*
116-
117-
# Patterns from access-control-webhook/.gitignore
118-
access-control-webhook/config/.ssh/
119-
access-control-webhook/config/hooks.json
120-
access-control-webhook/config/run/automation_rsa
121-
122-
# Patterns from glances/.gitignore
123-
glances/glances.conf
124-
glances/glances.pwd
125-
126-
# Patterns from shairport-sync/.gitignore
127-
shairport-sync/config/shairport-sync.conf
128-
129-
# Patterns from invidious/.gitignore
130-
invidious/config/config.yml
131-
invidious/config/sql/
132-
133-
# Patterns from snapserver/.gitignore
134-
snapserver/config/snapcast.conf
135-
136-
# Patterns from airconnect/.gitignore
137-
airconnect/config/*.xml
138-
139-
# Patterns from grafana/.gitignore
140-
grafana/config/grafana.ini
141-
142-
# Patterns from mqtt-explorer/.gitignore
143-
mqtt-explorer/config/settings.json
144-
145-
# Patterns from mosquitto/.gitignore
146-
mosquitto/config/mosquitto.conf
147-
mosquitto/config/mos_passwd
148-
149-
# Patterns from nginx-proxy-manager/.gitignore
150-
nginx-proxy-manager/config/
151-
nginx-proxy-manager/letsencrypt/

apps/cups/.env.example

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# UID/GID the CUPS process runs as inside the container.
2+
# Match the host user that owns ../../lib/cups if you care about file permissions.
3+
PUID=1000
4+
PGID=1000
5+
6+
TZ=America/Los_Angeles
7+
8+
#IMAGE_VERSION=latest

apps/cups/.rsync-exclude

Whitespace-only changes.

apps/cups/README.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# cups
2+
3+
Containerised CUPS print server using the
4+
[LinuxServer CUPS image](https://docs.linuxserver.io/images/docker-cups/),
5+
which ships with a comprehensive set of print filters and supporting programs:
6+
7+
| Package | Purpose |
8+
|---|---|
9+
| `cups` | Core print server and IPP listener |
10+
| `cups-filters` | PDF, PostScript, raster, and text filter chain |
11+
| `ghostscript` | PS/PDF rendering |
12+
| `poppler-utils` | PDF inspection and conversion |
13+
| `qpdf` | PDF linearisation and repair |
14+
| `imagemagick` | Image format conversion (PNG, JPEG, TIFF, …) |
15+
| `foomatic-db` + `foomatic-db-engine` | Generic printer driver database |
16+
| `printer-driver-gutenprint` | High-quality open-source raster drivers |
17+
| `hplip` | HP printer drivers |
18+
| `libcupsimage2t64` | CUPS raster image library |
19+
20+
## Networks
21+
22+
| Network alias | Actual network | Purpose |
23+
|---|---|---|
24+
| `cups` | `cups-net` | Other containers join this to submit print jobs |
25+
| `proxy` | `nginx-proxy-net` | Reverse proxy access to the CUPS web UI |
26+
27+
## Volumes
28+
29+
| Mount | Purpose |
30+
|---|---|
31+
| `../../lib/cups``/config` | All CUPS state: spool, logs, per-queue PPDs |
32+
| `./config/cupsd.conf``/etc/cups/cupsd.conf` (read-only) | Scheduler config; pre-configured to accept connections from `@LOCAL` (all Docker networks and LAN hosts) |
33+
| `./ppds``/usr/share/cups/model/custom` (read-only) | Custom PPD files; any PPD placed here appears as an available driver in the CUPS add-printer wizard |
34+
35+
## Adding custom PPDs
36+
37+
Drop `.ppd` files into the `ppds/` directory next to this file. They are
38+
mounted read-only into CUPS's model directory and appear automatically under
39+
**Administration → Add Printer → Choose Driver** the next time you open the
40+
wizard (no restart required).
41+
42+
Example — adding the Rongta RP326 driver:
43+
44+
```sh
45+
cp /path/to/Printer80.ppd apps/cups/ppds/
46+
```
47+
48+
## First-time setup
49+
50+
```sh
51+
cp .env.example .env
52+
# Edit .env if you need non-default PUID/PGID or TZ
53+
54+
cp config/cupsd.conf.default config/cupsd.conf
55+
# Edit config/cupsd.conf if you need to restrict or expand access
56+
57+
docker compose up -d
58+
```
59+
60+
The CUPS web UI is available at `http://cups:631` from other containers on
61+
`cups-net`, or via nginx-proxy-manager if you set up a proxy host pointing
62+
to `cups:631`.
63+
64+
To allow other containers to print without credentials, open the CUPS web UI
65+
and under **Administration → Server** enable:
66+
67+
- Allow printing from the Internet
68+
- Allow remote administration
69+
70+
## Adding a printer from another container
71+
72+
Any container that needs to print should join `cups-net`:
73+
74+
```yaml
75+
networks:
76+
cups:
77+
external: true
78+
name: cups-net
79+
```
80+
81+
Then configure the app's printer URL as `ipp://cups:631/printers/<queue-name>`.
82+
83+
## Stopping safely
84+
85+
```sh
86+
docker compose down
87+
```
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# CUPS scheduler configuration
2+
# Configured for network access from Docker containers and the local subnet.
3+
# See https://www.cups.org/doc/man-cupsd.conf.html for full reference.
4+
5+
# Listen on all interfaces so other containers and LAN hosts can connect.
6+
# The default "Listen localhost:631" would block all external access.
7+
Port 631
8+
Listen /run/cups/cups.sock
9+
10+
# Allow mDNS/DNS-SD printer discovery on the LAN.
11+
Browsing Yes
12+
BrowseLocalProtocols dnssd
13+
14+
# Default log destinations.
15+
AccessLog syslog
16+
ErrorLog syslog
17+
LogLevel warn
18+
19+
# Paths
20+
ServerRoot /etc/cups
21+
StateDir /var/lib/cups
22+
RequestRoot /var/spool/cups
23+
TempDir /var/spool/cups/tmp
24+
25+
MaxLogSize 0
26+
27+
# Restrict access to the local subnet and Docker networks.
28+
# @LOCAL matches any interface that is not the loopback and any
29+
# address on those interfaces — covers both the host LAN and
30+
# all attached Docker bridge networks.
31+
<Location />
32+
Order allow,deny
33+
Allow @LOCAL
34+
</Location>
35+
36+
<Location /admin>
37+
Order allow,deny
38+
Allow @LOCAL
39+
</Location>
40+
41+
<Location /admin/conf>
42+
AuthType Default
43+
Require user @SYSTEM
44+
Order allow,deny
45+
Allow @LOCAL
46+
</Location>
47+
48+
<Location /admin/log>
49+
AuthType Default
50+
Require user @SYSTEM
51+
Order allow,deny
52+
Allow @LOCAL
53+
</Location>
54+
55+
<Policy default>
56+
JobPrivateAccess default
57+
JobPrivateValues default
58+
SubscriptionPrivateAccess default
59+
SubscriptionPrivateValues default
60+
61+
<Limit Create-Job Print-Job Print-URI Validate-Job>
62+
Order deny,allow
63+
Allow @LOCAL
64+
</Limit>
65+
66+
<Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
67+
Require user @OWNER @SYSTEM
68+
Order deny,allow
69+
Allow @LOCAL
70+
</Limit>
71+
72+
<Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>
73+
AuthType Default
74+
Require user @SYSTEM
75+
Order deny,allow
76+
Allow @LOCAL
77+
</Limit>
78+
79+
<Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
80+
AuthType Default
81+
Require user @SYSTEM
82+
Order deny,allow
83+
Allow @LOCAL
84+
</Limit>
85+
86+
<Limit Cancel-Job CUPS-Authenticate-Job>
87+
Require user @OWNER @SYSTEM
88+
Order deny,allow
89+
Allow @LOCAL
90+
</Limit>
91+
92+
<Limit All>
93+
Order deny,allow
94+
Allow @LOCAL
95+
</Limit>
96+
</Policy>

apps/cups/docker-compose.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
services:
2+
cups:
3+
image: lscr.io/linuxserver/cups:${IMAGE_VERSION:-latest}
4+
container_name: cups
5+
hostname: cups
6+
restart: unless-stopped
7+
environment:
8+
PUID: ${PUID:-1000}
9+
PGID: ${PGID:-1000}
10+
TZ: ${TZ:-America/Los_Angeles}
11+
volumes:
12+
- ../../lib/cups:/config
13+
- ./config/cupsd.conf:/etc/cups/cupsd.conf:ro
14+
- ./ppds:/usr/share/cups/model/custom:ro
15+
# ports:
16+
# - 631:631
17+
networks:
18+
- cups
19+
- proxy
20+
healthcheck:
21+
test: ["CMD-SHELL", "curl -fSs http://localhost:631/ || exit 1"]
22+
interval: 30s
23+
timeout: 10s
24+
retries: 3
25+
start_period: 15s
26+
27+
networks:
28+
cups:
29+
name: cups-net
30+
proxy:
31+
external: true
32+
name: nginx-proxy-net

apps/cups/ppds/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)