Skip to content

Commit

Permalink
add: add cups-files.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
KyoungsueKim committed Dec 18, 2023
1 parent f48b993 commit e7df322
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 2 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ COPY ./verbose-waffle /opt/project/verbose-waffle
COPY requirements.txt /opt/project

RUN apt-get update && apt-get install -y cups libcups2-dev
COPY cups-files.conf /etc/cups/cups-files.conf
RUN service cups start

RUN pip install --no-cache-dir --upgrade -r /opt/project/requirements.txt
Expand Down
97 changes: 97 additions & 0 deletions cups-files.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
#
# File/directory/user/group configuration file for the CUPS scheduler.
# See "man cups-files.conf" for a complete description of this file.
#

# List of events that are considered fatal errors for the scheduler...
#FatalErrors config

# Do we call fsync() after writing configuration or status files?
#SyncOnClose Yes

# Default user and group for filters/backends/helper programs; this cannot be
# any user or group that resolves to ID 0 for security reasons...
#User lp
#Group lp

# Administrator user group, used to match @SYSTEM in cupsd.conf policy rules...
# This cannot contain the Group value for security reasons...
SystemGroup lpadmin


# User that is substituted for unauthenticated (remote) root accesses...
#RemoteRoot remroot

# Do we allow file: device URIs other than to /dev/null?
FileDevice Yes

# Permissions for configuration and log files...
#ConfigFilePerm 0640
#LogFilePerm 00640

# Specifies the group name or ID that will be used for log files.
# The default group in Debian is "adm".
LogFileGroup adm

# Location of the file logging all access to the scheduler; may be the name
# "syslog". If not an absolute path, the value of ServerRoot is used as the
# root directory. Also see the "AccessLogLevel" directive in cupsd.conf.
AccessLog /var/log/cups/access_log

# Location of cache files used by the scheduler...
#CacheDir /var/cache/cups

# Location of data files used by the scheduler...
#DataDir /usr/share/cups

# Location of the static web content served by the scheduler...
#DocumentRoot /usr/share/cups/doc-root

# Location of the file logging all messages produced by the scheduler and any
# helper programs; may be the name "syslog". If not an absolute path, the value
# of ServerRoot is used as the root directory. Also see the "LogLevel"
# directive in cupsd.conf.
ErrorLog /var/log/cups/error_log

# Location of fonts used by older print filters...
#FontPath /usr/share/cups/fonts

# Location of LPD configuration
#LPDConfigFile

# Location of the file logging all pages printed by the scheduler and any
# helper programs; may be the name "syslog". If not an absolute path, the value
# of ServerRoot is used as the root directory. Also see the "PageLogFormat"
# directive in cupsd.conf.
PageLog /var/log/cups/page_log

# Location of the file listing all of the local printers...
#Printcap /run/cups/printcap

# Format of the Printcap file...
#PrintcapFormat bsd
#PrintcapFormat plist
#PrintcapFormat solaris

# Location of all spool files...
#RequestRoot /var/spool/cups

# Location of helper programs...
#ServerBin /usr/lib/cups

# SSL/TLS keychain for the scheduler...
#ServerKeychain ssl

# Location of other configuration files...
#ServerRoot /etc/cups

# Location of Samba configuration file...
#SMBConfigFile

# Location of scheduler state files...
#StateDir /run/cups

# Location of scheduler/helper temporary files. This directory is emptied on
# scheduler startup and cannot be one of the standard (public) temporary
# directory locations for security reasons...
#TempDir /var/spool/cups/tmp
4 changes: 2 additions & 2 deletions verbose-waffle/core/printers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

def get_page_cnt(id: str):
with open(f'temp/{id}.pdf', 'rb') as pdf_file:
pdf_reader = PyPDF2.PdfFileReader(pdf_file)
cnt = pdf_reader.numPages
pdf_reader = PyPDF2.PdfReader(pdf_file)
cnt = len(pdf_reader.pages)

return cnt

Expand Down

0 comments on commit e7df322

Please sign in to comment.