Skip to content

Piero Bosio Social Web Site Personale Logo Fediverso

Social Forum federato con il resto del mondo. Non contano le istanze, contano le persone

Jellyfin on FreeBSD

The BSD Cafe Journal
1 1 0
  • We all love media – to some extent at least!
    Movies, TV Shows and all the moving pictures we can find and consume.
    So, since we all have movies etc. on our NAS/HDD/SSD/whatever we should be able to play and see everything we have on all our connected devices.
    But what can we do?
    Simple, we leverage Jellyfin to present our media to us.

    In this little howto we will set up Jellyfin in a Jail on FreeBSD.

    Let’s get right to it!

    Creating the Jail

    Jails can be created in different ways. In this howto however we will use Bastille – which is a excellent tool for creating Jails.

    This howto will not go into detail of how to set up Bastille. If you need to set up Bastille first, given you have not installed said tool, you can have a look at the quickstart guide:
    Bastille Quickstart Guide

    Right, let’s create the Jail first.

    $ sudo bastille create media 14.3-RELEASE 10.0.23.77/24 vtnet0

    You of course need to change the IP address and network interface (vtnet0 is probably not what you want!). Also, one can of course change the name of the Jail – I’ve chosen media since that describes the use case well of said Jail.
    After that our Jail is ready!

    Jellyfin needs mlock to be enabled to work properly.

    $ sudo bastille config media set allow.mlock 1

    But wait a second… How do I access all my media files?
    There is no access in the Jail to any directory on the host holding all my videos!
    Right, that is the case indeed!
    So, what can we do?
    Simple, we just mount our media directory in the Jail with nullfs!

    $ sudo bastille mount "media" /home/x/videos/ /videos nullfs ro 0 0

    This line mount /home/x/videos/ in the Jail under /videos. Also, I mount the directory as readonly – which you can change by sepcifying rw on the command above. Be sure to also select the correct Jail – in my case media.

    Jail fun with Jellyfin

    We can now finally enter the jail to further go along with the howto.

    $ sudo bastille console media

    Let’s first install Jellyfin which is directly accessible from the official package repository.

    $ pkg$ pkg update -f$ pkg install -y jellyfin

    The first command pkg bootstraps the pkg package manager. The second command refreshes the package cache and the last command installs Jellyfin itself.

    Right, so far so good.
    But we also need to configure Jellfin (Service) to always start. And, last but not least, we need to start Jellyfin – since it is not running after the installation finished.

    $ sysrc jellyfin_enable="YES"$ service jellyfin start

    We did all that, alright… But how do we know Jellyfin is running?
    Let’s have a look at the ps and sockstat output.

    root@media:~ # sockstat -l4USER     COMMAND    PID   FD  PROTO  LOCAL ADDRESS         FOREIGN ADDRESS      jellyfin jellyfin   10700 478 udp4   10.0.23.77:7359       *:*jellyfin jellyfin   10700 503 tcp4   10.0.23.77:8096       *:*
    root@media:~ # ps ax  PID TT  STAT    TIME COMMAND10662  -  SsJ  0:00.00 /usr/sbin/syslogd -ss10699  -  IsJ  0:00.00 daemon: /usr/local/jellyfin/jellyfin[10700] (daemon)10700  -  IJ   0:03.81 /usr/local/jellyfin/jellyfin --datadir /var/db/jellyfin --cachedir /var/cache/jellyfin10706  -  SsJ  0:00.00 /usr/sbin/cron -J 60 -s10804  1  IJ   0:00.00 login [pam] (login)10805  1  SJ   0:00.01 -sh (sh)10842  1  R+J  0:00.00 ps ax

    Ah yes, Jellyfin is running and listening on port 8096 – which is the designated port for Jellyfin!

    Jellyfin all the way!

    Since we established that Jellyfin is running and listening, let’s open our webbrowser of choice and navigate over to the install wizard.

    $ firefox http://10.0.23.77:8096

    We are greated with the intital Jellyfin wizard.
    I will not go into detail on how to set up the wizard. But don’t worry, there is a excellent guide over on the official Jellyfin website.
    The guide can be found here: Jellyfin Setup Wizard guide

    Be sure to add your nullfs mounted directory in your library to be able to play said videos and shows.

    That is all there is to it.
    Simple, easy and clean. Everything is done in a Jail and isolated. Also, mounting a media directory is easy and straightforward via bastille mount.

    Final words

    This little howto just shows how versatile jails are. One can of course tweak the setup further and for example add a reverse proxy (like Nginx) to the mix.
    The sky is the limit – Tools like bastille are very powerful and flexible!

    Enjoy!

    …and as always:

    Stay Open!

  • stefano@mastodon.bsd.cafeundefined stefano@mastodon.bsd.cafe shared this topic

Gli ultimi otto messaggi ricevuti dalla Federazione
  • We all love media – to some extent at least!
    Movies, TV Shows and all the moving pictures we can find and consume.
    So, since we all have movies etc. on our NAS/HDD/SSD/whatever we should be able to play and see everything we have on all our connected devices.
    But what can we do?
    Simple, we leverage Jellyfin to present our media to us.

    In this little howto we will set up Jellyfin in a Jail on FreeBSD.

    Let’s get right to it!

    Creating the Jail

    Jails can be created in different ways. In this howto however we will use Bastille – which is a excellent tool for creating Jails.

    This howto will not go into detail of how to set up Bastille. If you need to set up Bastille first, given you have not installed said tool, you can have a look at the quickstart guide:
    Bastille Quickstart Guide

    Right, let’s create the Jail first.

    $ sudo bastille create media 14.3-RELEASE 10.0.23.77/24 vtnet0

    You of course need to change the IP address and network interface (vtnet0 is probably not what you want!). Also, one can of course change the name of the Jail – I’ve chosen media since that describes the use case well of said Jail.
    After that our Jail is ready!

    Jellyfin needs mlock to be enabled to work properly.

    $ sudo bastille config media set allow.mlock 1

    But wait a second… How do I access all my media files?
    There is no access in the Jail to any directory on the host holding all my videos!
    Right, that is the case indeed!
    So, what can we do?
    Simple, we just mount our media directory in the Jail with nullfs!

    $ sudo bastille mount "media" /home/x/videos/ /videos nullfs ro 0 0

    This line mount /home/x/videos/ in the Jail under /videos. Also, I mount the directory as readonly – which you can change by sepcifying rw on the command above. Be sure to also select the correct Jail – in my case media.

    Jail fun with Jellyfin

    We can now finally enter the jail to further go along with the howto.

    $ sudo bastille console media

    Let’s first install Jellyfin which is directly accessible from the official package repository.

    $ pkg$ pkg update -f$ pkg install -y jellyfin

    The first command pkg bootstraps the pkg package manager. The second command refreshes the package cache and the last command installs Jellyfin itself.

    Right, so far so good.
    But we also need to configure Jellfin (Service) to always start. And, last but not least, we need to start Jellyfin – since it is not running after the installation finished.

    $ sysrc jellyfin_enable="YES"$ service jellyfin start

    We did all that, alright… But how do we know Jellyfin is running?
    Let’s have a look at the ps and sockstat output.

    root@media:~ # sockstat -l4USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS jellyfin jellyfin 10700 478 udp4 10.0.23.77:7359 *:*jellyfin jellyfin 10700 503 tcp4 10.0.23.77:8096 *:*root@media:~ # ps ax PID TT STAT TIME COMMAND10662 - SsJ 0:00.00 /usr/sbin/syslogd -ss10699 - IsJ 0:00.00 daemon: /usr/local/jellyfin/jellyfin[10700] (daemon)10700 - IJ 0:03.81 /usr/local/jellyfin/jellyfin --datadir /var/db/jellyfin --cachedir /var/cache/jellyfin10706 - SsJ 0:00.00 /usr/sbin/cron -J 60 -s10804 1 IJ 0:00.00 login [pam] (login)10805 1 SJ 0:00.01 -sh (sh)10842 1 R+J 0:00.00 ps ax

    Ah yes, Jellyfin is running and listening on port 8096 – which is the designated port for Jellyfin!

    Jellyfin all the way!

    Since we established that Jellyfin is running and listening, let’s open our webbrowser of choice and navigate over to the install wizard.

    $ firefox http://10.0.23.77:8096

    We are greated with the intital Jellyfin wizard.
    I will not go into detail on how to set up the wizard. But don’t worry, there is a excellent guide over on the official Jellyfin website.
    The guide can be found here: Jellyfin Setup Wizard guide

    Be sure to add your nullfs mounted directory in your library to be able to play said videos and shows.

    That is all there is to it.
    Simple, easy and clean. Everything is done in a Jail and isolated. Also, mounting a media directory is easy and straightforward via bastille mount.

    Final words

    This little howto just shows how versatile jails are. One can of course tweak the setup further and for example add a reverse proxy (like Nginx) to the mix.
    The sky is the limit – Tools like bastille are very powerful and flexible!

    Enjoy!

    …and as always:

    Stay Open!

    read more

  • @tykling @stefano@journal.bsd.cafe yes, It Is. I compiled it and I will document the procedure by writing a blog post (it's almost ready)

    read more

  • @stefano cool! Is it running on ? I can't find a port for the server.

    read more

  • read more

  • @stefano@journal.bsd.cafe At this rate my home server will become obsolete — I'll simply host all my things on @stefano servers :-D

    read more

  • Push notifications have been part of our lives for almost twenty years now. Our days are often punctuated by notifications of all kinds: a new message from the bank, a chat among friends, the work group, the ever-present social networks. All these notifications often have one thing in common: they pass through the servers of our smartphone operating system manufacturers, primarily Apple and Google.

    It’s part of the implementation, and that’s fine. But we need to be aware that these notifications reveal a lot about us: in the best case, metadata (meaning they know who sends them to us, the size, etc.). In the worst case, the entire content. Sure, we have nothing to hide. But this morning, when I received a bank transfer from a client, I didn’t lean out the window shouting to the whole neighborhood that a transfer had arrived from that client, of a specific amount, with a specific reference.

    UnifiedPush is a protocol that allows creating a different infrastructure for notification distribution. Notifications use WebPush, so they’re encrypted by the sender (e.g., Mastodon or Matrix server) and decrypted by the device. The server, therefore, doesn’t see the notification content itself.

    The Service

    I’m announcing a service that has already been active for some time – almost a year – on BSD Cafe servers. It’s an ntfy server, and the rationale is simple: if you use it for BSD Cafe services (like Mastodon and Matrix), no notification or data will leave BSD Cafe servers to pass through third parties: from BSD Cafe server, to BSD Cafe ntfy, to your device.

    Server address: https://ntfy.bsd.cafe

    Obviously it’s not limited only to BSD Cafe services, but you can use it with any other service that supports ntfy or UnifiedPush.

    How to Use It

    Just install the ntfy app (available on F-Droid, Play Store, etc.), go to settings and set https://ntfy.bsd.cafe as the server. From that moment on, any app opening a UnifiedPush channel will do so through that server.

    The server is also accessible via pure https, from a browser: https://ntfy.bsd.cafe

    From there you can also create a topic, subscribe, and send or receive messages and updates.

    Why

    The goal is, also with this service, to provide another opportunity to access content and services without necessarily depending on a fixed provider, because monoculture is and will always be a problem.

    The service is available to everyone. Happy notifications!

    read more
Post suggeriti