1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 19:52:06 +00:00
iiab/roles/cups/README.md

68 lines
2.8 KiB
Markdown
Raw Normal View History

2021-07-13 22:46:21 +00:00
# CUPS Printing README
[CUPS](https://en.wikipedia.org/wiki/CUPS) (also known as the "Common UNIX Printing System") is the standards-based, open source printing system for Linux and macOS.
It allows your [Internet-in-a-Box (IIAB)](https://internet-in-a-box.org) to act as a print server.
2021-07-14 13:23:21 +00:00
This can be useful if a printer is attached to your IIAB — so student/teacher print jobs from client computers and phones can be processed — and then sent to the appropriate printer.
2021-07-15 13:55:45 +00:00
## Using it
2021-07-13 22:46:21 +00:00
2021-07-15 18:47:18 +00:00
Make sure your IIAB was installed with these 2 lines in [/etc/iiab/local_vars.yml](http://faq.iiab.io/#What_is_local_vars.yml_and_how_do_I_customize_it.3F) :
```
cups_install: True
cups_enabled: True
```
Then visit your IIAB's http://box/print > **Administration** and log in using:
2021-07-13 22:46:21 +00:00
2021-07-13 23:29:36 +00:00
- Username: `Admin`
- Password: `changeme`
2021-07-13 22:46:21 +00:00
2021-07-15 13:55:45 +00:00
Or use any Linux account that is a member of the Linux group: `lpadmin`
_Browser pop-ups will try to scare you — click (and persist!) to log in despite these exaggerated warnings._
2021-07-13 22:46:21 +00:00
2021-07-13 23:29:36 +00:00
## Security
2021-07-13 22:46:21 +00:00
2021-07-13 23:29:36 +00:00
The above uses 'SystemGroup lpadmin' in `/etc/cups/cups-files.conf` — in coordination with about 15 '@SYSTEM' lines and 'DefaultAuthType Basic' in `/etc/cups/cupsd.conf`
2021-07-13 22:46:21 +00:00
CUPS creates a 10-year ["self-signed" HTTPS certificate](https://www.cups.org/doc/encryption.html) during installation, that will be very confusing to non-technical users when they log in, as a result of modern browser warnings.
2021-07-13 23:29:36 +00:00
## How it Works
2021-07-15 13:55:45 +00:00
Understand how IIAB configures CUPS for all IP addresses and all hostnames (IIAB redirects to bypass the "since 2009" CUPS problem mentioned below!) by reading these in-line explanations:
2021-07-13 23:29:36 +00:00
- [/opt/iiab/iiab/roles/cups/tasks/install.yml](tasks/install.yml)
Modify these 2 files at your own risk:
- [/etc/cups/cupsd.conf](https://www.cups.org/doc/man-cupsd.conf.html) (run `sudo cupsctl` and `sudo cupsd -t` to verify the file!)
- [/etc/nginx/conf.d/cups.conf](templates/cups.conf.j2)
2021-07-15 13:13:51 +00:00
If you make modifications to the above files, don't forget to restart systemd services: (run this as root)
2021-07-13 23:29:36 +00:00
```
systemctl restart cups cups-browsed nginx
```
2021-07-15 13:55:45 +00:00
2021-07-15 13:13:51 +00:00
## Troubleshooting
2021-07-15 18:47:18 +00:00
Visit your IIAB's http://box/print > **Help** for printer configuration suggestions, Etc!
2021-07-15 13:55:45 +00:00
2021-07-15 13:13:51 +00:00
http://localhost:631 is very useful if NGINX redirects or CUPS permissions are set wrong.
2021-07-15 13:55:45 +00:00
Beware that http://box:631 and http://box.lan:631 _will not work,_ due to a [known issue](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=530027) with CUPS since 2009.
2021-07-15 13:13:51 +00:00
Run `ps aux | grep cups` and `systemctl status cups` to verify the CUPS systemd service is running well.
2021-07-15 18:47:18 +00:00
Finally, keep an eye on: `/var/log/cups/error_log`
2021-07-13 23:29:36 +00:00
## Docs and Updates
2021-07-13 22:46:21 +00:00
- https://www.cups.org/documentation.html
- https://github.com/apple/cups/releases
- https://openprinting.github.io/cups/
- https://github.com/OpenPrinting/cups/releases/