Skip to content

Commit 1e435bd

Browse files
committed
README.md: removed trailing whitespace (present on some lines)
1 parent 88a5328 commit 1e435bd

1 file changed

Lines changed: 94 additions & 94 deletions

File tree

README.md

Lines changed: 94 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -235,37 +235,37 @@ start ipp-usb when needed.
235235
sudo snap install docker
236236
```
237237

238-
#### **Running the `ipp-usb` Container with Persistent Storage**
238+
#### **Running the `ipp-usb` Container with Persistent Storage**
239239

240-
To run the `ipp-usb` container while ensuring that its state persists across restarts, follow these steps.
240+
To run the `ipp-usb` container while ensuring that its state persists across restarts, follow these steps.
241241

242-
#### **1. Pull the `ipp-usb` Docker Image**
243-
The latest image is available on the GitHub Container Registry. Pull it using:
242+
#### **1. Pull the `ipp-usb` Docker Image**
243+
The latest image is available on the GitHub Container Registry. Pull it using:
244244
```sh
245245
sudo docker pull ghcr.io/openprinting/ipp-usb:latest
246246
```
247247

248-
#### **2. Create Persistent Storage Volumes**
249-
To ensure that configuration settings and printer state persist across container restarts, create two Docker volumes:
248+
#### **2. Create Persistent Storage Volumes**
249+
To ensure that configuration settings and printer state persist across container restarts, create two Docker volumes:
250250

251251
```sh
252252
sudo docker volume create ipp-usb-state
253253
sudo docker volume create ipp-usb-conf
254-
```
254+
```
255255

256-
These volumes store:
256+
These volumes store:
257257

258-
- **`ipp-usb-state` (`/var/ipp-usb/`)**
259-
- Device state files (`/var/ipp-usb/dev/`) – Ensures stable TCP port allocation and DNS-SD name resolution.
260-
- Lock files (`/var/ipp-usb/lock/`) – Prevents multiple instances from running simultaneously.
261-
- Log files (`/var/log/ipp-usb/`) – Can be optionally mounted if needed for debugging.
258+
- **`ipp-usb-state` (`/var/ipp-usb/`)**
259+
- Device state files (`/var/ipp-usb/dev/`) – Ensures stable TCP port allocation and DNS-SD name resolution.
260+
- Lock files (`/var/ipp-usb/lock/`) – Prevents multiple instances from running simultaneously.
261+
- Log files (`/var/log/ipp-usb/`) – Can be optionally mounted if needed for debugging.
262262

263-
- **`ipp-usb-conf` (`/etc/ipp-usb/`)**
264-
- Configuration file (`/etc/ipp-usb/ipp-usb.conf`) – Stores user-defined settings.
265-
- Quirks files (`/etc/ipp-usb/quirks/`) – Contains printer-specific workarounds.
263+
- **`ipp-usb-conf` (`/etc/ipp-usb/`)**
264+
- Configuration file (`/etc/ipp-usb/ipp-usb.conf`) – Stores user-defined settings.
265+
- Quirks files (`/etc/ipp-usb/quirks/`) – Contains printer-specific workarounds.
266266

267-
#### **3. Run the Container with Required Mounts**
268-
Start the container with appropriate options:
267+
#### **3. Run the Container with Required Mounts**
268+
Start the container with appropriate options:
269269

270270
```sh
271271
sudo docker run -d --network host \
@@ -277,11 +277,11 @@ sudo docker run -d --network host \
277277
ghcr.io/openprinting/ipp-usb:latest
278278
```
279279

280-
- **`--network host`** → Uses the host’s network to enable proper IPP-over-USB and Avahi service discovery.
281-
- **`-v /dev/bus/usb:/dev/bus/usb:ro`** → Grants read-only access to USB devices for printer detection.
282-
- **`-v ipp-usb-state:/var/ipp-usb`** → Mounts the persistent storage volume for printer state, lock files, and logs.
283-
- **`-v ipp-usb-conf:/etc/ipp-usb`** → Ensures configuration and quirks files persist across reboots.
284-
- **`--device-cgroup-rule='c 189:* rmw'`** → Grants read, write, and management permissions for USB printers inside the container.
280+
- **`--network host`** → Uses the host’s network to enable proper IPP-over-USB and Avahi service discovery.
281+
- **`-v /dev/bus/usb:/dev/bus/usb:ro`** → Grants read-only access to USB devices for printer detection.
282+
- **`-v ipp-usb-state:/var/ipp-usb`** → Mounts the persistent storage volume for printer state, lock files, and logs.
283+
- **`-v ipp-usb-conf:/etc/ipp-usb`** → Ensures configuration and quirks files persist across reboots.
284+
- **`--device-cgroup-rule='c 189:* rmw'`** → Grants read, write, and management permissions for USB printers inside the container.
285285

286286

287287
### Building and Running `ipp-usb` Locally
@@ -298,43 +298,43 @@ sudo docker run -d --network host \
298298
sudo snap install rockcraft --classic
299299
```
300300

301-
**To Build and Run the `ipp-usb` Rock Image Locally, follow these steps**
301+
**To Build and Run the `ipp-usb` Rock Image Locally, follow these steps**
302302

303-
#### **1. Build the `ipp-usb` Rock Image**
304-
The first step is to build the Rock image from the `rockcraft.yaml` configuration file. This image will include all required dependencies and configurations for `ipp-usb`.
303+
#### **1. Build the `ipp-usb` Rock Image**
304+
The first step is to build the Rock image from the `rockcraft.yaml` configuration file. This image will include all required dependencies and configurations for `ipp-usb`.
305305

306-
Navigate to the directory containing `rockcraft.yaml` and run:
306+
Navigate to the directory containing `rockcraft.yaml` and run:
307307
```sh
308308
rockcraft pack -v
309-
```
309+
```
310310

311-
#### **2. Convert the Rock Image to a Docker Image**
312-
Once the `.rock` file is built, convert it into a Docker image using:
311+
#### **2. Convert the Rock Image to a Docker Image**
312+
Once the `.rock` file is built, convert it into a Docker image using:
313313
```sh
314314
sudo rockcraft.skopeo --insecure-policy copy oci-archive:<rock_image> docker-daemon:ipp-usb:latest
315-
```
315+
```
316316

317-
#### **3. Create Persistent Storage Volumes**
318-
To ensure that configuration settings and printer state persist across container restarts, create two Docker volumes:
317+
#### **3. Create Persistent Storage Volumes**
318+
To ensure that configuration settings and printer state persist across container restarts, create two Docker volumes:
319319

320320
```sh
321321
sudo docker volume create ipp-usb-state
322322
sudo docker volume create ipp-usb-conf
323-
```
323+
```
324324

325-
These volumes store:
325+
These volumes store:
326326

327-
- **`ipp-usb-state` (`/var/ipp-usb/`)**
328-
- Device state files (`/var/ipp-usb/dev/`) – Ensures stable TCP port allocation and DNS-SD name resolution.
329-
- Lock files (`/var/ipp-usb/lock/`) – Prevents multiple instances from running simultaneously.
330-
- Log files (`/var/log/ipp-usb/`) – Can be optionally mounted if needed for debugging.
327+
- **`ipp-usb-state` (`/var/ipp-usb/`)**
328+
- Device state files (`/var/ipp-usb/dev/`) – Ensures stable TCP port allocation and DNS-SD name resolution.
329+
- Lock files (`/var/ipp-usb/lock/`) – Prevents multiple instances from running simultaneously.
330+
- Log files (`/var/log/ipp-usb/`) – Can be optionally mounted if needed for debugging.
331331

332-
- **`ipp-usb-conf` (`/etc/ipp-usb/`)**
333-
- Configuration file (`/etc/ipp-usb/ipp-usb.conf`) – Stores user-defined settings.
334-
- Quirks files (`/etc/ipp-usb/quirks/`) – Contains printer-specific workarounds.
332+
- **`ipp-usb-conf` (`/etc/ipp-usb/`)**
333+
- Configuration file (`/etc/ipp-usb/ipp-usb.conf`) – Stores user-defined settings.
334+
- Quirks files (`/etc/ipp-usb/quirks/`) – Contains printer-specific workarounds.
335335

336-
#### **4. Run the Container with Required Mounts**
337-
Start the container with appropriate options:
336+
#### **4. Run the Container with Required Mounts**
337+
Start the container with appropriate options:
338338

339339
```sh
340340
sudo docker run -d --network host \
@@ -346,11 +346,11 @@ sudo docker run -d --network host \
346346
ipp-usb:latest
347347
```
348348

349-
- **`--network host`** → Uses the host’s network to enable proper IPP-over-USB and Avahi service discovery.
350-
- **`-v /dev/bus/usb:/dev/bus/usb:ro`** → Grants read-only access to USB devices for printer detection.
351-
- **`-v ipp-usb-state:/var/ipp-usb`** → Mounts the persistent storage volume for printer state, lock files, and logs.
352-
- **`-v ipp-usb-conf:/etc/ipp-usb`** → Ensures configuration and quirks files persist across reboots.
353-
- **`--device-cgroup-rule='c 189:* rmw'`** → Grants read, write, and management permissions for USB printers inside the container.
349+
- **`--network host`** → Uses the host’s network to enable proper IPP-over-USB and Avahi service discovery.
350+
- **`-v /dev/bus/usb:/dev/bus/usb:ro`** → Grants read-only access to USB devices for printer detection.
351+
- **`-v ipp-usb-state:/var/ipp-usb`** → Mounts the persistent storage volume for printer state, lock files, and logs.
352+
- **`-v ipp-usb-conf:/etc/ipp-usb`** → Ensures configuration and quirks files persist across reboots.
353+
- **`--device-cgroup-rule='c 189:* rmw'`** → Grants read, write, and management permissions for USB printers inside the container.
354354

355355
### Accessing the Container Shell
356356

@@ -360,103 +360,103 @@ To enter the running `ipp-usb` container and access a shell inside it, use:
360360
```
361361
This allows you to inspect logs, debug issues, or manually run commands inside the container.
362362

363-
### Configuration
363+
### Configuration
364364

365-
The `ipp-usb` container uses a configuration file located at:
365+
The `ipp-usb` container uses a configuration file located at:
366366
```sh
367367
/etc/ipp-usb/ipp-usb.conf
368368
```
369-
By default, the container uses the built-in configuration, which can be modified from inside the container.
369+
By default, the container uses the built-in configuration, which can be modified from inside the container.
370370

371-
**Modifying the Configuration File Inside the Container**
371+
**Modifying the Configuration File Inside the Container**
372372

373-
#### **1. Enter the Running Container**
374-
Use the following command to access the container’s shell:
373+
#### **1. Enter the Running Container**
374+
Use the following command to access the container’s shell:
375375
```sh
376376
sudo docker exec -it ipp-usb bash
377377
```
378378

379-
#### **2. Open the Configuration File in Nano**
380-
Once inside the container, open the configuration file using `nano`:
379+
#### **2. Open the Configuration File in Nano**
380+
Once inside the container, open the configuration file using `nano`:
381381
```sh
382382
nano /etc/ipp-usb/ipp-usb.conf
383383
```
384384

385-
#### **3. Edit and Save the File**
386-
- Make the necessary changes to the file.
387-
- Press `CTRL + X`, then `Y`, and hit `Enter` to save the changes.
385+
#### **3. Edit and Save the File**
386+
- Make the necessary changes to the file.
387+
- Press `CTRL + X`, then `Y`, and hit `Enter` to save the changes.
388388

389-
#### **4. Restart the Container to Apply Changes**
390-
Exit the container and restart it to apply the updated configuration:
389+
#### **4. Restart the Container to Apply Changes**
390+
Exit the container and restart it to apply the updated configuration:
391391
```sh
392392
sudo docker restart ipp-usb
393393
```
394394

395-
### **Viewing Logs in the `ipp-usb` Container**
395+
### **Viewing Logs in the `ipp-usb` Container**
396396

397-
The `ipp-usb` container logs important events and errors to `/var/log/ipp-usb/`. Logs are categorized into:
397+
The `ipp-usb` container logs important events and errors to `/var/log/ipp-usb/`. Logs are categorized into:
398398

399-
- **Main log file:** `/var/log/ipp-usb/main.log` → Captures overall service activity, including errors and general events.
400-
- **Per-device logs:** `/var/log/ipp-usb/<DEVICE>.log` → Individual log files for each detected printer, helpful for troubleshooting device-specific issues.
399+
- **Main log file:** `/var/log/ipp-usb/main.log` → Captures overall service activity, including errors and general events.
400+
- **Per-device logs:** `/var/log/ipp-usb/<DEVICE>.log` → Individual log files for each detected printer, helpful for troubleshooting device-specific issues.
401401

402-
#### **1. Using Docker Logs**
402+
#### **1. Using Docker Logs**
403403

404-
To view real-time logs from the running container, use:
404+
To view real-time logs from the running container, use:
405405
```sh
406406
sudo docker logs -f ipp-usb
407-
```
408-
- The `-f` flag follows the logs in real-time.
409-
- Replace `ipp-usb` with your actual container name if different.
407+
```
408+
- The `-f` flag follows the logs in real-time.
409+
- Replace `ipp-usb` with your actual container name if different.
410410

411-
#### **2. Viewing Logs Inside the Container**
411+
#### **2. Viewing Logs Inside the Container**
412412

413-
If you need to inspect logs manually, first enter the container shell:
413+
If you need to inspect logs manually, first enter the container shell:
414414
```sh
415415
sudo docker exec -it ipp-usb bash
416-
```
416+
```
417417

418-
Once inside the container, you can use the following commands:
418+
Once inside the container, you can use the following commands:
419419

420-
#### **2.1 Monitor Logs in Real-Time**
420+
#### **2.1 Monitor Logs in Real-Time**
421421

422-
- **Main log file:**
422+
- **Main log file:**
423423
```sh
424424
tail -f /var/log/ipp-usb/main.log
425-
```
426-
This continuously displays new log entries for the entire service.
425+
```
426+
This continuously displays new log entries for the entire service.
427427

428-
- **Per-device log file (Replace `<DEVICE>` with your printer's identifier):**
428+
- **Per-device log file (Replace `<DEVICE>` with your printer's identifier):**
429429
```sh
430430
tail -f /var/log/ipp-usb/<DEVICE>.log
431-
```
431+
```
432432

433-
#### **2.2 Display Full Log Files**
433+
#### **2.2 Display Full Log Files**
434434

435-
- **Show full contents of the main log file:**
435+
- **Show full contents of the main log file:**
436436
```sh
437437
cat /var/log/ipp-usb/main.log
438-
```
438+
```
439439

440-
- **Show logs for a specific device:**
440+
- **Show logs for a specific device:**
441441
```sh
442442
cat /var/log/ipp-usb/<DEVICE>.log
443-
```
443+
```
444444

445-
#### **2.3 List Available Device Logs**
445+
#### **2.3 List Available Device Logs**
446446

447-
To see all available per-device log files, run:
447+
To see all available per-device log files, run:
448448
```sh
449449
ls /var/log/ipp-usb/
450-
```
450+
```
451451

452-
#### **3. Persisting Logs Across Container Restarts**
452+
#### **3. Persisting Logs Across Container Restarts**
453453

454-
If you want logs to persist across container restarts, you should mount the log directory using a Docker volume or a host directory.
454+
If you want logs to persist across container restarts, you should mount the log directory using a Docker volume or a host directory.
455455

456-
**Required Docker Flags for Log Persistence:**
457-
- `-v <volume-name>:/var/log/ipp-usb` → Mounts a Docker volume for log persistence.
458-
- **or**
459-
- `-v <host-directory>:/var/log/ipp-usb` → Mounts a host directory to retain logs outside the container.
456+
**Required Docker Flags for Log Persistence:**
457+
- `-v <volume-name>:/var/log/ipp-usb` → Mounts a Docker volume for log persistence.
458+
- **or**
459+
- `-v <host-directory>:/var/log/ipp-usb` → Mounts a host directory to retain logs outside the container.
460460

461461
These options ensure that logs remain available even after the container stops or is recreated, allowing for easier troubleshooting and auditing.
462462

0 commit comments

Comments
 (0)