69
ct/pinchflat.sh
Normal file
69
ct/pinchflat.sh
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||||
|
# Copyright (c) 2021-2026 community-scripts ORG
|
||||||
|
# Author: nnsense
|
||||||
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
|
# Source: https://github.com/kieraneglin/pinchflat
|
||||||
|
|
||||||
|
APP="Pinchflat"
|
||||||
|
var_tags="${var_tags:-media;youtube;downloader}"
|
||||||
|
var_cpu="${var_cpu:-2}"
|
||||||
|
var_ram="${var_ram:-2048}"
|
||||||
|
var_disk="${var_disk:-8}"
|
||||||
|
var_os="${var_os:-debian}"
|
||||||
|
var_version="${var_version:-13}"
|
||||||
|
var_unprivileged="${var_unprivileged:-1}"
|
||||||
|
var_gpu="${var_gpu:-yes}"
|
||||||
|
|
||||||
|
header_info "$APP"
|
||||||
|
variables
|
||||||
|
color
|
||||||
|
catch_errors
|
||||||
|
|
||||||
|
function update_script() {
|
||||||
|
header_info
|
||||||
|
check_container_storage
|
||||||
|
check_container_resources
|
||||||
|
|
||||||
|
if [[ ! -d /opt/pinchflat/app ]]; then
|
||||||
|
msg_error "No ${APP} installation found."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if check_for_gh_release "pinchflat" "kieraneglin/pinchflat"; then
|
||||||
|
msg_info "Stopping Service"
|
||||||
|
systemctl stop pinchflat
|
||||||
|
msg_ok "Stopped Service"
|
||||||
|
|
||||||
|
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "pinchflat" "kieraneglin/pinchflat" "tarball" "latest" "/opt/pinchflat-src"
|
||||||
|
|
||||||
|
msg_info "Building Pinchflat"
|
||||||
|
cd /opt/pinchflat-src
|
||||||
|
export MIX_ENV=prod
|
||||||
|
export ERL_FLAGS="+JPperf true"
|
||||||
|
$STD mix deps.get --only prod
|
||||||
|
$STD mix deps.compile
|
||||||
|
$STD yarn --cwd assets install
|
||||||
|
$STD mix assets.deploy
|
||||||
|
$STD mix compile
|
||||||
|
$STD mix release --overwrite
|
||||||
|
rm -rf /opt/pinchflat/app
|
||||||
|
cp -r _build/prod/rel/pinchflat /opt/pinchflat/app
|
||||||
|
msg_ok "Built Pinchflat"
|
||||||
|
|
||||||
|
msg_info "Starting Service"
|
||||||
|
systemctl start pinchflat
|
||||||
|
msg_ok "Started Service"
|
||||||
|
msg_ok "Updated successfully!"
|
||||||
|
fi
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
|
start
|
||||||
|
build_container
|
||||||
|
description
|
||||||
|
msg_ok "Completed Successfully!\n"
|
||||||
|
|
||||||
|
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||||
|
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
||||||
|
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8945${CL}"
|
||||||
125
install/pinchflat-install.sh
Normal file
125
install/pinchflat-install.sh
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Copyright (c) 2021-2026 community-scripts ORG
|
||||||
|
# Author: nnsense
|
||||||
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
|
# Source: https://github.com/kieraneglin/pinchflat
|
||||||
|
|
||||||
|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||||
|
|
||||||
|
color
|
||||||
|
verb_ip6
|
||||||
|
catch_errors
|
||||||
|
setting_up_container
|
||||||
|
network_check
|
||||||
|
update_os
|
||||||
|
|
||||||
|
msg_info "Installing Dependencies"
|
||||||
|
$STD apt install -y \
|
||||||
|
build-essential \
|
||||||
|
elixir \
|
||||||
|
erlang-dev \
|
||||||
|
erlang-inets \
|
||||||
|
erlang-os-mon \
|
||||||
|
erlang-runtime-tools \
|
||||||
|
erlang-syntax-tools \
|
||||||
|
erlang-xmerl \
|
||||||
|
git \
|
||||||
|
libsqlite3-dev \
|
||||||
|
locales \
|
||||||
|
openssh-client \
|
||||||
|
openssl \
|
||||||
|
pipx \
|
||||||
|
pkg-config \
|
||||||
|
procps \
|
||||||
|
python3-mutagen \
|
||||||
|
zip
|
||||||
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
|
NODE_VERSION="24" NODE_MODULE="yarn" setup_nodejs
|
||||||
|
FFMPEG_TYPE="binary" setup_ffmpeg
|
||||||
|
setup_hwaccel
|
||||||
|
fetch_and_deploy_gh_release "deno" "denoland/deno" "prebuild" "latest" "/usr/local/bin" "deno-x86_64-unknown-linux-gnu.zip"
|
||||||
|
fetch_and_deploy_gh_release "yt-dlp" "yt-dlp/yt-dlp" "singlefile" "latest" "/usr/local/bin" "yt-dlp_linux"
|
||||||
|
|
||||||
|
msg_info "Installing Apprise"
|
||||||
|
export PIPX_HOME=/opt/pipx
|
||||||
|
export PIPX_BIN_DIR=/usr/local/bin
|
||||||
|
$STD pipx install apprise
|
||||||
|
msg_ok "Installed Apprise"
|
||||||
|
|
||||||
|
fetch_and_deploy_gh_release "pinchflat" "kieraneglin/pinchflat" "tarball" "latest" "/opt/pinchflat-src"
|
||||||
|
|
||||||
|
msg_info "Configuring Pinchflat"
|
||||||
|
CONFIG_PATH="/opt/pinchflat/config"
|
||||||
|
DOWNLOADS_PATH="/opt/pinchflat/downloads"
|
||||||
|
mkdir -p \
|
||||||
|
/etc/elixir_tzdata_data \
|
||||||
|
/etc/yt-dlp/plugins \
|
||||||
|
/opt/pinchflat/app \
|
||||||
|
"$CONFIG_PATH/db" \
|
||||||
|
"$CONFIG_PATH/extras" \
|
||||||
|
"$CONFIG_PATH/logs" \
|
||||||
|
"$CONFIG_PATH/metadata" \
|
||||||
|
"$DOWNLOADS_PATH"
|
||||||
|
ln -sfn "$CONFIG_PATH" /config
|
||||||
|
ln -sfn "$DOWNLOADS_PATH" /downloads
|
||||||
|
chmod ugo+rw /etc/elixir_tzdata_data /etc/yt-dlp /etc/yt-dlp/plugins
|
||||||
|
|
||||||
|
cat <<EOF >/opt/pinchflat/.env
|
||||||
|
LANG=en_US.UTF-8
|
||||||
|
LANGUAGE=en_US:en
|
||||||
|
LC_ALL=en_US.UTF-8
|
||||||
|
MIX_ENV=prod
|
||||||
|
PHX_SERVER=true
|
||||||
|
PORT=8945
|
||||||
|
RUN_CONTEXT=selfhosted
|
||||||
|
CONFIG_PATH=${CONFIG_PATH}
|
||||||
|
MEDIA_PATH=${DOWNLOADS_PATH}
|
||||||
|
TZ_DATA_PATH=/etc/elixir_tzdata_data
|
||||||
|
SECRET_KEY_BASE=$(openssl rand -base64 48)
|
||||||
|
EOF
|
||||||
|
msg_ok "Configured Pinchflat"
|
||||||
|
|
||||||
|
msg_info "Building Pinchflat"
|
||||||
|
cd /opt/pinchflat-src
|
||||||
|
export MIX_ENV=prod
|
||||||
|
export ERL_FLAGS="+JPperf true"
|
||||||
|
$STD mix local.hex --force
|
||||||
|
$STD mix local.rebar --force
|
||||||
|
$STD mix deps.get --only prod
|
||||||
|
$STD mix deps.compile
|
||||||
|
$STD yarn --cwd assets install
|
||||||
|
$STD mix assets.deploy
|
||||||
|
$STD mix compile
|
||||||
|
$STD mix release --overwrite
|
||||||
|
rm -rf /opt/pinchflat/app
|
||||||
|
cp -r _build/prod/rel/pinchflat /opt/pinchflat/app
|
||||||
|
msg_ok "Built Pinchflat"
|
||||||
|
|
||||||
|
msg_info "Creating Service"
|
||||||
|
cat <<EOF >/etc/systemd/system/pinchflat.service
|
||||||
|
[Unit]
|
||||||
|
Description=Pinchflat
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
EnvironmentFile=/opt/pinchflat/.env
|
||||||
|
WorkingDirectory=/opt/pinchflat/app
|
||||||
|
UMask=0022
|
||||||
|
ExecStartPre=/opt/pinchflat/app/bin/check_file_permissions
|
||||||
|
ExecStartPre=/opt/pinchflat/app/bin/migrate
|
||||||
|
ExecStart=/opt/pinchflat/app/bin/pinchflat start
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=5
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
systemctl enable -q --now pinchflat
|
||||||
|
msg_ok "Created Service"
|
||||||
|
|
||||||
|
motd_ssh
|
||||||
|
customize
|
||||||
|
cleanup_lxc
|
||||||
48
json/pinchflat.json
Normal file
48
json/pinchflat.json
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
{
|
||||||
|
"name": "Pinchflat",
|
||||||
|
"slug": "pinchflat",
|
||||||
|
"categories": [
|
||||||
|
13
|
||||||
|
],
|
||||||
|
"date_created": "2026-05-05",
|
||||||
|
"type": "ct",
|
||||||
|
"updateable": true,
|
||||||
|
"privileged": false,
|
||||||
|
"interface_port": 8945,
|
||||||
|
"documentation": "https://github.com/kieraneglin/pinchflat/wiki",
|
||||||
|
"website": "https://github.com/kieraneglin/pinchflat",
|
||||||
|
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/pinchflat.webp",
|
||||||
|
"description": "Pinchflat is a self-hosted YouTube media manager built with yt-dlp for automatically downloading and organizing content from channels and playlists.",
|
||||||
|
"install_methods": [
|
||||||
|
{
|
||||||
|
"type": "default",
|
||||||
|
"script": "ct/pinchflat.sh",
|
||||||
|
"config_path": "/opt/pinchflat/.env",
|
||||||
|
"resources": {
|
||||||
|
"cpu": 2,
|
||||||
|
"ram": 2048,
|
||||||
|
"hdd": 8,
|
||||||
|
"os": "Debian",
|
||||||
|
"version": "13"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"default_credentials": {
|
||||||
|
"username": null,
|
||||||
|
"password": null
|
||||||
|
},
|
||||||
|
"notes": [
|
||||||
|
{
|
||||||
|
"text": "For large media libraries, increase disk space or mount external storage at `/opt/pinchflat/downloads` before downloading media to avoid filling the LXC disk.",
|
||||||
|
"type": "warning"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "Pinchflat data is stored in `/opt/pinchflat/config`",
|
||||||
|
"type": "info"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "downloaded media is stored in `/opt/pinchflat/downloads`",
|
||||||
|
"type": "info"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user