Skip to content

Commit

Permalink
add CUPS printing system
Browse files Browse the repository at this point in the history
  • Loading branch information
zdraganov committed Dec 2, 2024
1 parent 4bb5741 commit f312a9e
Show file tree
Hide file tree
Showing 3 changed files with 160 additions and 0 deletions.
81 changes: 81 additions & 0 deletions ct/cups.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/usr/bin/env bash
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2024 tteck
# Author: tteck (tteckster)
# License: MIT
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE

function header_info {
clear
cat <<"EOF"
________ ______ _____
/ ____/ / / / __ \/ ___/
/ / / / / / /_/ /\__ \
/ /___/ /_/ / ____/___/ /
\____/\____/_/ /____/
EOF
}
header_info
echo -e "Loading..."
APP="cups"
var_disk="8"
var_cpu="1"
var_ram="512"
var_os="debian"
var_version="12"
variables
color
catch_errors

function default_settings() {
CT_TYPE="1"
PW=""
CT_ID=$NEXTID
HN=$NSAPP
DISK_SIZE="$var_disk"
CORE_COUNT="$var_cpu"
RAM_SIZE="$var_ram"
BRG="vmbr0"
NET="dhcp"
GATE=""
APT_CACHER=""
APT_CACHER_IP=""
DISABLEIP6="no"
MTU=""
SD=""
NS=""
MAC=""
VLAN=""
SSH="no"
VERB="no"
echo_default
}

function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /etc/cups ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
msg_info "Stopping ${APP} Service"
systemctl stop cups
msg_ok "Stopped ${APP} Service"

msg_info "Updating..."
apt install --only-upgrade cups &>/dev/null
msg_ok "Update Successfully"

msg_info "Starting ${APP}"
systemctl start cups
msg_ok "Started ${APP}"
msg_ok "Updated Successfully"
exit
}

start
build_container
description

msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:631${CL}\n"
45 changes: 45 additions & 0 deletions install/cups-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env bash

# Copyright (c) 2021-2024 tteck
# Author: tteck (tteckster)
# License: MIT
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE

source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os


msg_info "Installing Dependencies"
$STD apt-get install -y curl
$STD apt-get install -y sudo
$STD apt-get install -y mc
msg_ok "Installed Dependencies"

msg_info "Install CUPS"
$STD apt-get install -y cups
msg_ok "Installed CUPS"

msg_info "Add lpadmin to root group"
$STD usermod -aG lpadmin root
msg_ok "Added lpadmin to root group"

msg_info "Starting Service"
systemctl enable -q --now cups
msg_ok "Started Service"

msg_info "Allow remote administration"
$STD cupsctl --remote-admin --remote-any --share-printers
msg_ok "Allowed remote administration"

motd_ssh
customize

msg_info "Cleaning up"
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"
34 changes: 34 additions & 0 deletions json/cups.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "CUPS",
"slug": "CUPS",
"categories": [
0
],
"date_created": "2024-12-02",
"type": "ct",
"updateable": false,
"privileged": false,
"interface_port": 631,
"documentation": null,
"website": "https://www.cups.org/",
"logo": "https://www.cups.org/apple-touch-icon.png",
"description": "The standards-based, open source printing system developed by Apple for iOS®, iPadOS®, and macOS®. CUPS uses IPP Everywhere™ to support printing to local and network printers.",
"install_methods": [
{
"type": "default",
"script": "ct/cups.sh",
"resources": {
"cpu": 1,
"ram": 512,
"hdd": 8,
"os": "debian",
"version": "12"
}
}
],
"default_credentials": {
"username": "root",
"password": null
},
"notes": []
}

0 comments on commit f312a9e

Please sign in to comment.