Сломана установка PeerTube в Yunohost (на февраль 2025) - что делать?
1. Установите Node.js и Yarn:
sudo -i
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt install -y nodejs
npm install -g yarn@1.22.22
export PATH=$PATH:/usr/lib/node_modules/yarn/bin
echo 'export PATH=$PATH:/usr/lib/node_modules/yarn/bin' >> /root/.bashrc
source /root/.bashrc
2. Проверьте версии:
node --version
npm --version
yarn --version
3. Запустите установку с правкой скрипта:
Теперь, когда Node.js и Yarn предустановлены, скорректируем скрипт, чтобы он использовал наш Yarn 1.22.22:
-- Запустите установку и остановитесь
sudo -i
yunohost app install peertube
Дождитесь запроса параметров (домен, путь), но не завершайте.
-- Найдите временный каталог
ls -d /var/cache/yunohost/app_tmp_work_dirs/*
-- Отредактируйте install
nano /var/cache/yunohost/app_tmp_work_dirs/app_<идентификатор>/scripts/install
Исправьте блок сборки: Найдите:
pushd "$install_dir"
ynh_hide_warnings ynh_exec_as_app yarn config set network-timeout 300000
ynh_hide_warnings ynh_exec_as_app yarn install --production --pure-lockfile
ynh_hide_warnings ynh_exec_as_app yarn cache clean
popd
Замените на:
pushd "$install_dir"
ynh_exec_as_app /usr/lib/node_modules/yarn/bin/yarn config set network-timeout 300000 || true
ynh_exec_as_app /usr/lib/node_modules/yarn/bin/yarn install --production --pure-lockfile || true
ynh_exec_as_app /usr/lib/node_modules/yarn/bin/yarn cache clean || true
popd
Исправьте блок плагинов: Найдите:
pushd "$install_dir"
ynh_hide_warnings ynh_exec_as_app NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production npm run plugin:install -- --npm-name peertube-plugin-auth-ldap
ynh_hide_warnings ynh_exec_as_app NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production npm run plugin:install -- --npm-name peertube-plugin-livechat
echo "$admin_pass" | ynh_hide_warnings ynh_exec_as_app NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production npm run reset-password -- -u root
popd
Замените на:
pushd "$install_dir"
ynh_exec_as_app /usr/lib/node_modules/yarn/bin/yarn add peertube-plugin-auth-ldap@0.0.14 || true
ynh_exec_as_app /usr/lib/node_modules/yarn/bin/yarn add peertube-plugin-livechat@0.5.2 || true
echo "$admin_pass" | ynh_exec_as_app NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production npm run reset-password -- -u root || true
popd
Сохраните (Ctrl+O, Enter, Ctrl+X).
4. Продолжите установку
Введите параметры и дождитесь завершения.
--------------------------------------------------------------------------
После этого нужно дать права на каталог с PeerTube, информация об этом здесь
https://pixelfed.nbics.net/books/u-2-peertube/page/vosstanovlenie-prav-na-katalog-peertube-v-yunohost