Skip to content

Commit

Permalink
Revert "Merge pull request #391 from YunoHost-Apps/testing"
Browse files Browse the repository at this point in the history
This reverts commit 2114cc9, reversing
changes made to 8a8d9be.
  • Loading branch information
ericgaspar committed Dec 29, 2023
1 parent 2114cc9 commit d5d2f8b
Show file tree
Hide file tree
Showing 32 changed files with 1,457 additions and 424 deletions.
133 changes: 133 additions & 0 deletions .github/workflows/updater.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
#!/bin/bash

#=================================================
# PACKAGE UPDATING HELPER
#=================================================

# This script is meant to be run by GitHub Actions
# The YunoHost-Apps organisation offers a template Action to run this script periodically
# Since each app is different, maintainers can adapt its contents so as to perform
# automatic actions when a new upstream release is detected.

# Remove this exit command when you are ready to run this Action
#exit 1

#=================================================
# FETCHING LATEST RELEASE AND ITS ASSETS
#=================================================

# Fetching information
current_version=$(cat manifest.json | jq -j '.version|split("~")[0]')
repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]')
# Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions)
version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1)
assets=($(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '[ .[] | select(.tag_name=="'$version'").assets[].browser_download_url ] | join(" ") | @sh' | tr -d "'"))

# Later down the script, we assume the version has only digits and dots
# Sometimes the release name starts with a "v", so let's filter it out.
# You may need more tweaks here if the upstream repository has different naming conventions.
if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then
version=${version:1}
fi

# Setting up the environment variables
echo "Current version: $current_version"
echo "Latest release from upstream: $version"
echo "VERSION=$version" >> $GITHUB_ENV
# For the time being, let's assume the script will fail
echo "PROCEED=false" >> $GITHUB_ENV

# Proceed only if the retrieved version is greater than the current one
if ! dpkg --compare-versions "$current_version" "lt" "$version" ; then
echo "::warning ::No new version available"
exit 0
# Proceed only if a PR for this new version does not already exist
elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.git ci-auto-update-v$version ; then
echo "::warning ::A branch already exists for this update"
exit 0
fi

# Each release can hold multiple assets (e.g. binaries for different architectures, source code, etc.)
echo "${#assets[@]} available asset(s)"

#=================================================
# UPDATE SOURCE FILES
#=================================================

# Here we use the $assets variable to get the resources published in the upstream release.
# Here is an example for Grav, it has to be adapted in accordance with how the upstream releases look like.

# Let's loop over the array of assets URLs
for asset_url in ${assets[@]}; do

echo "Handling asset at $asset_url"

# Assign the asset to a source file in conf/ directory
# Here we base the source file name upon a unique keyword in the assets url (admin vs. update)
# Leave $src empty to ignore the asset
case $asset_url in
*".tar.xz")
src="app"
;;
*)
src=""
;;
esac

# If $src is not empty, let's process the asset
if [ ! -z "$src" ]; then

# Create the temporary directory
tempdir="$(mktemp -d)"

# Download sources and calculate checksum
filename=${asset_url##*/}
curl --silent -4 -L $asset_url -o "$tempdir/$filename"
checksum=$(sha256sum "$tempdir/$filename" | head -c 64)

# Delete temporary directory
rm -rf $tempdir

# Get extension
if [[ $filename == *.tar.xz ]]; then
extension=tar.xz
else
extension=${filename##*.}
fi

# Rewrite source file
cat <<EOT > conf/$src.src
SOURCE_URL=$asset_url
SOURCE_SUM=$checksum
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=$extension
SOURCE_IN_SUBDIR=true
SOURCE_EXTRACT=true
EOT
echo "... conf/$src.src updated"

else
echo "... asset ignored"
fi

done

#=================================================
# SPECIFIC UPDATE STEPS
#=================================================

# Any action on the app's source code can be done.
# The GitHub Action workflow takes care of committing all changes after this script ends.

#=================================================
# GENERIC FINALIZATION
#=================================================

# Replace new version in manifest
echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.json)" > manifest.json

# No need to update the README, yunohost-bot takes care of it

# The Action will proceed only if the PROCEED environment variable is set to true
echo "PROCEED=true" >> $GITHUB_ENV
exit 0
50 changes: 50 additions & 0 deletions .github/workflows/updater.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected.
# You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization.
# This file should be enough by itself, but feel free to tune it to your needs.
# It calls updater.sh, which is where you should put the app-specific update steps.
name: Check for new upstream releases
on:
# Allow to manually trigger the workflow
workflow_dispatch:
# Run it every day at 6:00 UTC
schedule:
- cron: '0 6 * * *'
jobs:
updater:
runs-on: ubuntu-latest
steps:
- name: Fetch the source code
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run the updater script
id: run_updater
run: |
# Setting up Git user
git config --global user.name 'yunohost-bot'
git config --global user.email '[email protected]'
# Run the updater script
/bin/bash .github/workflows/updater.sh
- name: Commit changes
id: commit
if: ${{ env.PROCEED == 'true' }}
run: |
git commit -am "Upgrade to v$VERSION"
- name: Create Pull Request
id: cpr
if: ${{ env.PROCEED == 'true' }}
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update to version ${{ env.VERSION }}
committer: 'yunohost-bot <[email protected]>'
author: 'yunohost-bot <[email protected]>'
signoff: false
base: testing
branch: ci-auto-update-v${{ env.VERSION }}
delete-branch: true
title: 'Upgrade to version ${{ env.VERSION }}'
body: |
Upgrade to v${{ env.VERSION }}
draft: false

29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,42 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in

## Overview

PeerTube is a decentralized and federated video hosting software. To publish videos, the user must register with a host (called an instance). Each host has its own conditions of use (storage space per user, moderation rules, themes, etc.). Thanks to WebTorrent, if several people view the same video, fragments of it are exchanged between people so as not to overload the instance. Decentralized: Each instance can follow one or more other PeerTube instances in order to allow its users to view their videos. Federated: Via the ActivityPub protocol, Peertube can interact with other software that is part of the Fediverse, such as Mastodon for example.
Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser, using <a href="https://github.com/feross/webtorrent">WebTorrent</a>.


**Shipped version:** 6.0.2~ynh1
**Shipped version:** 5.2.1~ynh1

**Demo:** http://peertube.cpy.re

## Screenshots

![Screenshot of PeerTube](./doc/screenshots/screenshot1.jpg)

## Disclaimers / important information

### IMPORTANT POINT TO READ BEFORE INSTALLING
* Require **dedicated domain** like **peertube.domain.tld**.
* Admin username is: **root**.
* **Admin password and LDAP configuration** will be sent to the email address given at the time of the installation.
* URL can not be changed once selected. Choose the domain wisely.
* You need more then **1 GB** of RAM. If you don't have it, please create a **swap memory**.

$ dd if=/dev/zero of=/swapfile bs=1024 count=1048576
$ mkswap /swapfile
$ swapon /swapfile
$ echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
* This app is **multi-instance** (you can have more then one PeerTube instance running on a YunoHost server)
* **If you are hosted on OVH virtual machine or experiencing `gyp ERR! configure error`, please switch to [ovh_fix](https://github.com/YunoHost-Apps/peertube_ynh/tree/ovh_fix)**
* HTTP auth is not supported
* Do not modify the `/var/www/<app>/conf/production.yaml` file, because it will be overridden in the next upgrade. Please instead either change them though the web interface or create a `/var/www/<app>/conf/local.yaml` file, assign it the same owner, group and rights than for `conf/production.yaml` and fill there your specific settings.
* Note: when the same option have different values in `production.yaml` and `local.yaml` files, only the value in `local.yaml` is taken into account.

### PLUGINS
* LDAP auth is supported, LDAP configuration will be sent to the email address given at the time of the installation.
* PeerTube plugin livechat is installed with Prosody. To enable, just select «Prosody server controlled by Peertube» as chat mode in the plugin configutation of the PeerTube admin page
* During install, because of Prosody, Metronome is disabled

## Documentation and resources

* Official app website: <https://joinpeertube.org/fr>
Expand Down
30 changes: 28 additions & 2 deletions README_fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,43 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po

## Vue d’ensemble

PeerTube est un logiciel décentralisé et fédéré d’hébergement de vidéos. Pour publier des vidéos, l’utilisateur doit s’inscrire chez un hébergeur (nommé instance). Chaque hébergeur possède ses conditions d’utilisation (espace de stockage par utilisateur, règles de modération, thématiques, etc.). Grâce à WebTorrent, si plusieurs personnes consultent une même vidéo, des fragments de celle-ci sont échangés entre les personnes afin de ne pas surcharger l’instance. Décentralisé : Chaque instance peut suivre une ou plusieurs autres instances PeerTube afin de permettre à ses utilisateurs de visionner les vidéos de celles-ci. Fédéré : Via le protocole ActivityPub, Peertube peut interagir avec d’autres logiciels qui font partie du Fediverse, comme Mastodon par exemple.
Plateforme de streaming vidéo fédérée (ActivityPub) utilisant P2P (BitTorrent) directement dans le navigateur Web, en utilisant <a href="https://github.com/feross/webtorrent"> WebTorrent </a>


**Version incluse :** 6.0.2~ynh1
**Version incluse :** 5.2.1~ynh1

**Démo :** http://peertube.cpy.re

## Captures d’écran

![Capture d’écran de PeerTube](./doc/screenshots/screenshot1.jpg)

## Avertissements / informations importantes

### Points importants à lire avant l'installation
* Nécessite un **domaine dédié** comme **peertube.domain.tld**.
* Le nom d'utilisateur de l'administrateur est: **root**.
* **Le mot de passe administrateur et la configuration LDAP** seront envoyés à l'adresse email indiquée au moment de l'installation.
* L'URL ne peut pas être modifiée une fois sélectionnée. Choisissez judicieusement le domaine.
* Vous avez besoin de plus de **1 Go** de RAM. Si vous ne l'avez pas, veuillez créer une **mémoire swap**.

$ dd if=/dev/zero of=/swapfile bs=1024 count=1048576
$ mkswap /swapfile
$ swapon /swapfile
$ echo "/swapfile swap swap defaults 0 0" >> /etc/fstab

* Cette application est **multi-instance** (vous pouvez avoir plus d'une instance PeerTube en cours d'exécution sur un serveur YunoHost)
* **Si vous êtes hébergé sur une machine virtuelle OVH ou rencontrez `gyp ERR! configure error`, veuillez passer à [ovh_fix](https://github.com/YunoHost-Apps/peertube_ynh/tree/ovh_fix)**
* L'authentification HTTP n'est pas supportée
* Ne modifiez pas le fichier `/var/www/<app>/conf/production.yaml`, car il sera remplacé à la prochaine mise à jour. À la place, veuillez modifier la configuration via l'interface web ou créer et remplir le fichier `/var/www/<app>/conf/local.yaml`, assignez-lui les mêmes propriétaire, groupe et droits que pour `conf/production.yaml` et y remplir vos options spécifiques.
* Note: si la même option contient différentes valeurs dans les fichiers `conf/production.yaml` et `conf/local.yaml`, seule la valeur dans `conf/local.yaml` sera prise en compte.

#### PLUGINS

* L'authentification LDAP est prise en charge, les instructions de configuration sont envoyées à l'adresse email indiquée au moment de l'installation
* Le plugin PeerTube livechat est installé ainsi que Prosody. pour l'activer, sélectionner «Prosody server controlled by Peertube» dans le paramétre chat mode du plugin dans la page d'administration de PeerTube.
* Pendant l'installation, à cause de Prosody, Metronome est désactivé.

## Documentations et ressources

* Site officiel de l’app : <https://joinpeertube.org/fr>
Expand Down
66 changes: 66 additions & 0 deletions check_process
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
;; Test complet
; Manifest
domain="domain.tld"
is_public=1
admin="john"
; Checks
pkg_linter=1
setup_sub_dir=0
setup_root=1
setup_nourl=0
setup_private=1
setup_public=1
upgrade=1
# 3.2.1~ynh1
# upgrade=1 from_commit=f4b43fd85ad3a169d27c53865a13548e44f17ebf
# 3.2.1~ynh3
#upgrade=1 from_commit=7a621c48f6bdd10334f2d0c06f787fe468788f62
# 3.2.1~ynh4
upgrade=1 from_commit=08bf3fce3ad99e27e7f7d251838a9f9c63243e44
# 3.3.0~ynh1
#upgrade=1 from_commit=c43548f6e0a0e5d172360945f6941255537ec18c
# 3.3.0~ynh2
#upgrade=1 from_commit=6010986d58ef0caa8428e3d6e3ff3fd512401a53
# 3.3.0~ynh2
#upgrade=1 from_commit=f3bb02002c8fa28748744302475139b6fcf7c651
# 3.3.0~ynh3
#upgrade=1 from_commit=ed59a268e93910f8b35b0f87399f91b8cad9ede0
# 3.3.0~ynh4
#upgrade=1 from_commit=509ba9051facf65329dde20919a3254dcaf3f910
# 3.4.0~ynh1
#upgrade=1 from_commit=83a06ca4c96ccd941b49647b3698db2c6b771b79
# 3.4.1~ynh1
#upgrade=1 from_commit=96f010a9f72fed48660b3f962124b553397b283b
# 3.4.1~ynh2
#upgrade=1 from_commit=0b6823def8230b3af7f9b484c526a49c3a640c4d
# 3.4.1~ynh3
upgrade=1 from_commit=0f77bb6e7441698b762bde38698c510dc0a4438e
# 4.0.0~ynh1
#upgrade=1 from_commit=602bf56af8582a38c7ee055f60e782e2da0efddc
# 4.0.0~ynh1
#upgrade=1 from_commit=7c2bb0bb6a91b6b957b734f684aa3d64da892f4c
# 4.0.0~ynh1
#upgrade=1 from_commit=9bdfda10d83519064adeb275f6aed1660bf24b88
# 4.0.0~ynh2
#upgrade=1 from_commit=16bc11e945c2b1a962a5deace7c0f27b8d5a5112
# 4.0.0~ynh2
#upgrade=1 from_commit=6995b27972e27c6cf8ee3e1f23a2de5cc8c8e8ee
# 4.1.0~ynh1
#upgrade=1 from_commit=d5aa8c2194297b332d26e68b5e9e8ada17377742
# 4.1.1~ynh1
#upgrade=1 from_commit=24c8333d70312e9dcf8d278e64787ca561a10b2e
# 4.2.0~ynh1
#upgrade=1 from_commit=ddb937ecab9454e8dd0b07627a02bad27c9f6556
# 4.2.1~ynh1
#upgrade=1 from_commit=5a488aebc53dafa5c431580ca4437eed0ad7da1e
# 4.2.2~ynh1
upgrade=1 from_commit=9bf92ff65db0dcb188834738f180dbfa34ebef09
# 5.2.0~ynh1
upgrade=1 from_commit=fbf90aa8845edfb8bc1f75e335ea706203fe77e7
backup_restore=1
multi_instance=0
port_already_use=0
change_url=0
;;; Options
Email=
Notification=none
6 changes: 6 additions & 0 deletions conf/app.src
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SOURCE_URL=https://github.com/Chocobozzz/PeerTube/releases/download/v5.2.1/peertube-v5.2.1.tar.xz
SOURCE_SUM=27d577ab63d29be865934088d1831373a71433c78443a4441fb3ac416995817c
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.xz
SOURCE_IN_SUBDIR=true
SOURCE_EXTRACT=true
2 changes: 2 additions & 0 deletions conf/local-production.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
17 changes: 17 additions & 0 deletions conf/msg_install
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
__APP__ was successfully installed :)

Please open your __APP__ domain: https://__DOMAIN____PATH_URL__

The admin username is: root
The admin password is: __ADMIN_PASS__

To make PeerTube Live available, you also need to make the TCP port __RTMP_PORT__ available from internet (For example, opening the port on your ISP box if it's not automatically done).

To enable LDAP authentication open https://__DOMAIN____PATH_URL__admin/plugins/show/peertube-plugin-auth-ldap
Complete with the following informations :
- URL: ldap://127.0.0.1
- Insecure TLS : checked
- Search base : ou=users,dc=yunohost,dc=org
All YunoHost users will be allowed to login as peertube user.

If you are facing any problem or want to improve this app, please open a new issue here: https://github.com/YunoHost-Apps/peertube_ynh
15 changes: 15 additions & 0 deletions conf/msg_remove
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
__APP__ was successfully removed :)

The domain https://__DOMAIN____PATH_URL__ is free for other apps to be installed on it.

You should close the PeerTube Live TCP port __RTMP_PORT__ available from internet (For example, closing the port on your ISP box if it's not automatically done).

But a futher action is required from your side to completely remove the __APP__ data folder. If you have backup and plan to restore this app in the future DON'T RUN THIS COMMAND.
And if you are going to migrate to othe server you will have to move __DATADIR__ to your new server.


You need to run this command to remove the data (warning all your videos will be removed):

rm -R __DATADIR__ -f

If you facing any problem or want to improve this app, please open a new issue here: https://github.com/YunoHost-Apps/peertube_ynh
Loading

0 comments on commit d5d2f8b

Please sign in to comment.