Posts by blais708

    Description


    The purpose of this guide is to be able to launch a VPN client configuration file as a background process when we want, not necessarely at boot. So let say I want to download a torrent and would like to connect to a VPN server before starting the download, and stop the process when the download is finished (after seeding 2x minimum...obviously ;) ). In my case, I'm using a ProtonVPN client configuration file that I will modify so I can automatically login the server without a prompt from a terminal. But it could work with any client configuration.


    Steps


    1. Create a Shared Folder where you're planning to put the OpenVPN client config file ;
    2. Create a temporary SMB/CIFS or FTP to be able to access the share ;
    3. Give a user a proper access permission to write files in the share ;
    4. Place the client config file in the share (protonvpn_is-nl.ovpn in my case), change the extension to ".conf" (it seems to be prefereable for OpenVPN)
    5. Create a text file where you'll put the Username and the password to access the VPN server, I name the file pass.txt :


    Code
    username
    password


    6. You will now have the find the server share path where those files are on the server, on OMV 3.X it would be :
    /srv/dev-disk-by-label-label-device_label/share_name/
    In my case a created a share name protonvpn in the data device so it would look like this :
    /srv/dev-disk-by-label-data/protonvpn/
    7. Open the client config file with a text editor and change the line auth-user-pass to :


    Code
    auth-user-pass /srv/dev-disk-by-label-device_label/share_name/pass.txt

    8. Install the OMVEXTRA plugin for OMV 3.X if you haven't done so ;
    9. Install the OpenVPN plugin, we won't be using the plugin from OMV WebUI, but we need it to run a client (By the way, it would be nice to have a "client" tab in the plugin to configure a client from OMV!);
    10. Create a Scheduled Job to start the client on-demand, I set it to lauch yearly, as root, the following command :


    Code
    openvpn --config /srv/dev-disk-by-label-device_label/share_name/conf_file.conf --daemon

    11. Create a Scheduled Job to stop the client on-demand, I set it to launch yearly, as root, the following command :


    Code
    killall -SIGINT openvpn

    12. Create a Scheduled Job the check the public IP after starting the client, yearly, as root, the following command :

    Code
    wget -qO- http://ipecho.net/plain ; echo

    13. You can now delete the SMB/CIFS or FTP share


    Done!


    Conclusion


    You can now use the Schedule Jobs to run/stop the client in the background as you wish! Check the public IP to make sure you are connected to the VPN server!

    Configuring the MySQL Database


    1. Go to Services - MySQL , Click Enable, at the bottom Enable the SQL management site, click Save , Apply changes ;
    2. Click on the Show button, in the new tab User ID : root ; Password : leave_the_field_empty ;
    3. For extra security, I recommend adding a password for the root user, at the top bar, choose Tools > User Manager , at the Select a User dropdown menu choose root@localhost , add a password in the password field, then click Update User ;
    4. At the top bar choose Database > Create new..., Database name : pydio , Create Database ;
    PS. If you encounter an error access page during the creation of the database, simply reboot your server and repeat the step 4 ;)
    5. Log out and return to the OMV WebUI ;
    6. Go to Services > Nginx (webites) , click on the Pydio URL, Now click on CONTINUE TO PYDIO INSTALLATION!


    Pydio Setup Wizard


    1. Select language, Start Wizard ;
    2. Follow the Authentification forms ;
    3. At the Database Connection form, Host : localhost ; Databse : pydio ; user : root ; Password : mysql_root_password ;
    4. Detected Server URL : http://localhost:pydio_port/
    5. Select the default language ;
    6. Click Install Pydio !!!
    PS. You may see a screen where it tell you that it could not update the .htaccess file, select the code and modify the .htaccess file with a text editor in you pydio SMB share, then refresh the page!


    DONE!

    Description
    I decided to create a guide to install pydio 8 community edition using the nginx (websites) plug-in for OMV 3.X. I found a guide for OMV 2.X in the forum but it's tideous and I think it doesn't use the full power of OMV and the nginx plug-in. This guide do not require the use of a terminal nor an SSH remote connexion. Oh and by the way, I'm not an OMV or a linux expert... I got my experience from curiosity and online search so this guide may not be the optimal way to achieve what it is meant to do. So if you have any suggestions or recommendations to optimise this guide, feel free to do it! I will gladly update this guide and learn something new!


    FYI, each Inline-Code and code box represent an input from the user either by entering values, selecting an option from a list box, clicking something or adding a code.


    Sources
    Pydio for OMV 2.X guide in this Forum : here
    Pydio community website : Installing on Debian+Nginx
    Pydio administration Guides : Administration Guides


    Preparing the Shared Folder and installing Pydio
    First, we'll create the root folder to host the pydio website to be able install Pydio in it.


    1. In OMV WebUI, go to Access Rights Management > Shared Folders ;
    2. Click Add, Name : pydio ; Device : the_device_you_want and Save ;
    3. Go to Access Rights Management > User ;
    4. Select a User and click Privileges, give Read/Write permission to the "pydio" shared folder, Save , Apply changes ;
    5. We'll now download pydio 8 and extract the zip at the root of the shared folder so, I like to create a temporary SMB Share to extract the file, but you could use an FTP Share also if you prefer;
    6. Go to Services > SMB/CIFS , under the Settings tab, Enable the service if not already Enabled , Apply changes ;
    7. Under the Shares tab, click Add, Shared folder : pydio , leave the rest to default, Save , Apply changes ;
    8. Go to Pydio website and download the latest community zip package : https://pydio.com/en/get-pydio ;
    9. Once the download is complete, from your computer, access the "pydio" SMB share and extract the content of the pydio zip at the root of the share ;


    We are now ready to install the ngninx (websites) plug-in and configure our webserver to access the pydio website!


    Installing and configuring our Nginx server


    1. Download the OMVEXTRA deb package (for OMV 3.X) from here
    2. In OMV WebUI, go to System > Plugins, click on Upload and browse to the downloaded deb package, click Ok;
    3. After the page has refreshed, return to System > Plugins , under the section Utilities , select the openmediavault-omvextraorg 3.4.26 plugin (version at the time of writing) and Install , Close when done ;
    4. After the page has refreshed, go to System > OMV-Extras, select OMV-Extra.org , click Edit, Enablethe repository, Save , Applychanges ;
    5. Return to System > Plugins, under the Network section, select openmediavault-mysql 3.0.4 and openmediavault-nginx 3.0.11 plug-ins, and Install, Closewhen done ;
    6. Go to Services > Nginx (websites), under Settings tab Enable the service ;
    7. Under Pools tab, click Add , Name : pydio-php ; User : www-data ; Group : www-data ; Memory limit : Choose_depending_on_available_RAM ; Max Post size : 2048 ; Max upload filesize : 2048 ;
    7.1 In the Extra options section, add the following lines, this is required by Pydio to perform better :


    Code
    php_value[output_buffering] = Off
    php_value[max_file_uploads] = 20


    Notes on the php pool configuration
    Upload wise, the Max Pot Size value would mean the maximum amount of data you can upload at the same time, 2GB in this case. The Max Upload Filesise mean the maximum filesize of a single file, 2GB in this case. And, obviously, the max_file_uploads value means the maximum number of file you can upload at the same time. If any of these criterias are met, the upload will fail. Change the values to your needs. I like to keep things neat and I don't think I will upload more than 2GB of data at the same time via the pydio website. If my files are larger, I'll use an SMB share and upload them locally.


    7.2 Save , Apply changes ;
    8. Under the Servers tab, click Add , Enable ; Directory : pydio ; Port : Choose_any_except_80 (used by OMV WebUI) ; Enable SSL if you have and SSL certificate ; Enable PHP ; PHP-FPM pool : pydio-php ; Enable index.php ; in the Extra options, paste this code, which is adapted from the code presented in the OMV 2.X guide, without overwriting the configurations automatically made by OMV 3.X (root folder, logs, etc.)


    8.1 Save , Apply changes
    9. We now have to set the folder access in the pydio share for the webserver to function properly, go to Access Rights Management > Shared Folders ;
    10. Click pydio , Click on ACL ;
    11. In the Directory Pane, select the data folder, under the Extra option , set the Owner to www-data , the Group to www-data , Apply permissions to files and subfolders , click Apply ;
    12. We should now be able to access the pydio website! Go to Services > Nginx (websites) , click on the URL of the pydio website, a new tab opens and you should see the Pydio Diagnostic Tool, you should see 2-3 warnings, an SSL Encryption warning if you didn't use an SSL certificate, and PHP-GD and PHP-INTL warnings for the missing packages, DO NOT click on "CONTINUE TO PYDIO INSTALLATION" yet, there is still things to do! ;
    13. Let's install those missing packages, to avoid SSHing into the server, I like to create temporary jobs to execute small commands (or you could use the Shellinabox plug-in to run those commands too), go to System > Scheduled Jobs ;
    14. Click Add , Command : apt-get update && apt-get --yes --force-yes install php5-gd php5-intl php5-curl php5-apcu , Save , Apply changes.
    15. Select the job, click Run ,click Start , click Close when done. You can now Delete the Job, Apply changes
    16. Return to Services > Nginx (websites) , under Servers tab, click on the pydio URL , the warnings should have dissapeared (except for the SSL warning if you don't have an SSL certificate), close the Pydio Diagnostic Tool window.


    See the next steps in the following post!

    Hi again,


    So after doing some verifications, changing the ACL values on the share 'photos' on OMV side (Server #1) doesn't change anything since the uid=xxx,gid=xxx mount option in fstab overwrites the ACL. To make the Plex mobile app upload the photos to any samba/cifs share do the following prior to activating the Camera Upload feature on the app settings :


    Create a file where the share user name and password to be mounted will be stored


    Code
    sudo nano /root/.smbcredentials


    Code
    username=USERNAME
    password=PASSWORD


    Code
    sudo chown root:root /root/.smbcredentials
    sudo chmod 600 /root/.smbcredentials


    check the chown values of your plex folder:


    Code
    ls -la /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/


    In my case it is plex:nogroup, now check the associated user id (uid) and group id (gid) :


    grep plex /etc/passwd
    grep nogroup /etc/group


    As mentionned by tekkb, the gid could be 'plex' on i386 and amb64 architectures. Now, in /etc/fastb, mount your desired share :


    Code
    sudo nano /etc/fstab


    Code
    //REMOTE_SERVER/SHARE_NAME /mnt/MOUNTING/LOCATION cifs credentials=/root/.smbcredentials,iocharset=utf8,uid=PLEX_UID,gid=NOGROUP_GID,rw 0 0


    Now Reboot, I like to make sure that the share is properly mounted by creating a dummy file/folder in the share from the host machine. Then 'ls -la /mnt/MOUNTING/LOCATION', if you can see the dummy file/folder listed, your good to go! Now let's create a symlink in the plex «Media Upload» directory with the Library name you want (remember it, we'll use it in the Plex App later), or use the default 'Mobile Photos' pointing to the mounted share and chown the appropriate user:group :


    Code
    ln -s /mnt/MOUNTING/LOCATION/ /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Media\ Upload/Mobile\ Photos
    chown -h plex:nogroup /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Media\ Upload/Mobile\ Photos


    On your mobile device, navigate to the Plex App settings, go to Camera Upload, if you used 'Mobile Photos' as the symlink name you do not need to change de Library name, it's the default. But if you chose another one use the exact same name as the symlink. You can create an album if you want (useful if you have multiple devices linked to your Plex Media Server, ie. you can sort your pictures by devices' name). Finally activate the camera upload feature! Voilà!


    Cheers!

    Hi,


    Yes it's exactly what I'm trying to do, and it works! On the Server #2, I changed the fstab file to mount the share on Server #1 like this :


    Code
    //SERVER_#1/photos /mnt/samba/mycloud/photos cifs credentials=/root/.smbcredentials,iocharset=utf8,uid=108,rw 0 0


    Where the UID is the 'plex' user on Server #2.


    Today, I'll try to see if this could work without messing with the ACL on the share 'photos' en Server #1 and post all the steps required to make it work if someone else is interested to do it too.


    I think there would be a way to automated this if there were some kind of standards like some specific UIDs reserved to some particular usernames (i.e UID=0 for root on most UNIX systems)


    Cheers!

    It works...partially. As described in the previous post, changing the ACL of the share 'photos' on Server #1 to avahi:nogroup, on Server #2 it is seen as plex:nogroup, but still the photos won't appear in the 'photos' share on Server #1 when uploaded. But when I create a text file as root in two ways on Server #2 :


    Code
    nano /mnt/samba/mycloud/photos/test1.txt
    nano /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Media\ Upload/Photos/test2.txt


    I can see both new files in the share 'photos' on the Server #1


    But if I do the same as a normal user without sudo command, I get a 'permission denied' in nano when trying to save the files... So for now I guess that's why PMS can't write the images in the share...


    Any ideas?


    Thanks!

    OK... But I just want to remind that I have two machines : one that serve as a nas with OMV where I want all my data stored (Server #1), and another stock Debian Jessie Headless server with Plex Media Server installed (Server #2).


    Plex is not installed on the Server #1 via OMV plugin. Since Plex is installed on Server #2, OMV on Server #1 doesn't «deal» with Plex. What I'm trying to do is to make the Plex App upload my mobile photos in a 'photos' share on Server #1 via Plex Media Server on the Server #2. Server #1 doesn't have enough processing power to handle PMS properly.


    I feel that when I chown a directory a user:group, it assigns instead the associated UID:GID and that information sitcks with the directory wether it's being seen by Server #1 or Server #2. Since I created a user named « plex » on Server #1, it automatically assigned the UID 1005 to it. By making 'plex' the owner of the share 'photos' on Server #1, Server #2 sees it as 1005, where the latter isn't assigned to any user in Server #2. Since the UID of 'plex' user on Server #2 is 108, and that the UID 108 is assigned to 'avahi' user on Server #1, I'll try to make 'avahi' member of the group 'nogroup' on Server #1 and chown avahi:nogroup on the share 'photos', to make the Server #2 think it's plex:nogroup... I'll report back wether it works or not.


    Cheers!

    I say 2 things and maybe I come back...


    You can use the remote share plugin to mount a share from another device on your OMV.


    The chown plex is using is plex:plex, not plex:nogroup.


    True, I could install OMV on the Odroid XU4 and create a samba/cifs share from the Plex 'Photos' Library but that not what I want. First the Odroid XU4 is limited in space (16GB) and I want it to act as a "control" server, I want all my data stored in MyCloud.


    As for the chown plex is using, I didn't change anything when installing PMS :


    Code
    root@odroid:/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Media Upload$ ls -la
    total 8
    drwxr-xr-x 2 plex nogroup 4096 Jan 31 17:51 .
    drwxr-xr-x 12 plex nogroup 4096 Jan 31 18:04 ..
    lrwxrwxrwx 1 plex nogroup 26 Jan 31 17:51 Photos -> /mnt/samba/mycloud/photos/


    Thanks for your help!

    Hi everyone!


    First of all I want to thank the OMV team for such a great software!


    I'm doing something rather complicated (for my poor linux skills!) and i'm looking for some help! Here is my setup : I have one NAS (rooted WD MyCloud 2TB) running the latest OMV Stoneburner and an Odroid XU4 (eMMC 16GB) running Debian jessie Headless.


    Plex Media Server is installed on the Odroid XU4 (better processing power than the WD MyCloud). What I'm doing is mount all the shares created on the OMV NAS (i.e. music and videos) in the Odroid XU4 /mnt/samba/mycloud/* folder so I can scan them from the PMS web interface. For now it works perfecty. First I tried to mount the OMV 'photos' share directly in '/var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Media\ Upload/Photos/' with no success. I then found a tutorial suggesting to create a symlink with the 'Photos' name redirecting to the folder (local folder, not a samba share) where you want the mobile photos uploaded.


    So what I did is temporarely mount the Photos share, and created the symlink :


    Code
    sudo mount -t cifs //OMVSERVER_IP/photos /mnt/samba/mycloud/photos -o credentials=/root/.smbcredentials

    (where .smbcredentials contains username=USERNAME,password=USERNAME_PASSWORD)

    Code
    sudo ln -s /mnt/samba/mycloud/photos /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Media\ Upload/Photos


    I changed the owner and group to plex:nogroup :


    Code
    sudo chown -h plex:nogroup /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Media\ Upload/Photos


    The photos are "uploaded" to PMS but I can't find them in the 'Photos' share. And I can only see the thumbnails in the Plex app. In Odroid XU4, I ckecked the user:group on /mnt/samba/mycloud/photos and it is 'root:user' (default when OMV creates a share). To test, in the NAS OMV, I created a 'plex' user assigned with 'nogroup' then changed the 'Photos' ACL the plex:nogroup. When I checked the the user:group again in Odroid XU4, it showed 1005:nogroup. So my guess is that the UID for the plex user in the NAS is not the same in Odroid XU4. Indeed the default plex UID in the latter is 108.


    What can I do to make it work without messing with my PMS config? Can I change the plex UID? Do you have another suggestion? Idea?


    Thanks!


    PS. Sorry for my bad english ;)