User Tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
services:cloudcommander [2025/01/21 07:39] willyservices:cloudcommander [2025/01/21 12:58] (current) willy
Line 5: Line 5:
 ===== Installation ===== ===== Installation =====
  
-As usual, you will want to install it with it's own user:+Create a standard user to host the CloudCommander installation. You will most probably //never// run it as this user, but always as different users, to allow it manage files owned by those users. 
 <code bash> <code bash>
-useradd -d /data/daemons/cloudcmd -m cloudcmd -g users+useradd -d /data/daemons/cloudcmd -m cloudcmd 
 </code> </code>
  
Line 18: Line 19:
 </code> </code>
  
 +You might want to set this in the user **.bashrc** in case you want to give write permissions to users in a specific group to the files managed by CloudCommander: 
 +<file> 
 +export UMASK=0002 
 +</file>
  
 ===== Reverse Proxy ===== ===== Reverse Proxy =====
 +
 +Running CloudCommander behind NGINX is easy, this is an example:
 +<file - filebrowser.conf>
 +  location /cloudcmd/ {
 +        client_max_body_size 512M;
 +
 +        proxy_pass http://127.0.0.1:3002;
 +        proxy_http_version 1.1;
 +
 +        proxy_set_header Connection $http_connection;
 +        proxy_set_header Connection 'upgrade';
 +        proxy_cache_bypass $http_upgrade;
 +        proxy_set_header Host $host;
 +        proxy_set_header X-Real-IP $remote_addr;
 +        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 +        proxy_set_header X-Forwarded-Proto $scheme;
 +
 +    }
 +</file>
 +
 +Remember to set the correct port as each instance of CloudCommander will have to run with it's own port, and set a reasonable location URL. 
  
  
 ===== Running ===== ===== Running =====
  
 +You can run it by hand with the following example line:
 +<code bash>
 cloudcmd --packer zip --root /data/shares/common --prefix /common --port 5005 --confirm-copy --confirm-move --no-auth --no-config-auth --no-contact --vim --no-dropbox --name "Common Share" cloudcmd --packer zip --root /data/shares/common --prefix /common --port 5005 --confirm-copy --confirm-move --no-auth --no-config-auth --no-contact --vim --no-dropbox --name "Common Share"
 +</code>
 +
 +Or you can automate it...
 +
 +I assume you want to run it as user **myuser**.
 +
 +As the starting script, since i use OpenRC, i have written the following init script wihch needs to be dropped to **/etc/init.d/cloudcmd**:
 +<file cloudcmd>
 +#!/sbin/openrc-run
 +# Copyright 2024 Willy Garidol
 +# Distributed under the terms of the GNU General Public License v3
 +
 +depend() {
 +        need localmount net
 +}
 +
 +CC_SLOT="${SVCNAME#cloudcmd.}"
 +CC_USER=${USER:-${CC_SLOT}}
 +CC_GROUP=${GROUP:-${CC_SLOT}}
 +CC_PACKER=${PACKER:-zip}
 +
 +description=${DESCRIPTION:-Cloud based filebrowser}
 +pidfile="/run/${RC_SVCNAME}.pid"
 +command_background=true
 +command="/data/daemons/filebrowser/.npm_install/bin/cloudcmd"
 +command_args="--packer ${CC_PACKER} --root \"${FOLDER}\" --prefix ${BASE_URL} --port ${PORT} --confirm-copy --confirm-move --no-auth --no-config-auth --no-contact --vim --no-dropbox --name \“${DESCRIPTION}\”"
 +command_user="${CC_USER}:${CC_GROUP}"
 +
 +start_pre() {
 +        if [ "${CC_SLOT}" = "cloudcmd" ]
 +        then
 +                ebegin "Error: do not run this script, run a link to it!"
 +                eend 255
 +        fi
 +}
 +</file>
 +
 +make it executable!
 +
 +Now, create a file **/etc/conf.d/cloudcmd.myshare**:
 +<file filebrowser.myshare>
 +BASE_URL="/files/MyFiles"
 +DESCRIPTION="Common web archive"
 +FOLDER="/data/MyFiles"
 +GROUP="users"
 +PORT=3005
 +USER="filebrowser"
 +PACKER="zip" # or "tar"
 +</file>
 +
 +And create the symlink, start it and add to autostart:
 +<code bash>
 +ln -s /etc/init.d/cloudcmd  /etc/init.d/cloudcmd.myshare
 +rc-update add cloudcmd.myshare default
 +/etc/init.d/cloudcmd.myshare start
 +</code>
 +
 +To add more shares, just create new links to the //cloudcmd// init script and create the associated config file.
 +
 +
 +==== Updates ====
 +
 +<code bash>
 +npm u cloudcmd
 +</code>
  
  

This website uses technical cookies only. No information is shared with anybody or used in any way but provide the website in your browser.

More information