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 11:55] willyservices:cloudcommander [2025/01/21 12:58] (current) willy
Line 41: Line 41:
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header X-Forwarded-Proto $scheme;         proxy_set_header X-Forwarded-Proto $scheme;
-        #proxy_set_header Authorization $remote_user; 
  
     }     }
Line 51: Line 50:
 ===== 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...
- +
-==== Running ====+
  
 I assume you want to run it as user **myuser**. I assume you want to run it as user **myuser**.
  
-As a general startup rule, the first time you need to run it once to create the needed configuration files and database, then you want to start it with a script and have it start automatically at boot. +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>
-For initial configuration: +
-<code bash> +
-su - myuser +
-/data/daemons/filebrowser/bin/filebrowser -r "/data/MyFiles" -p 3005 -d "/home/myuser/filebrowser.db" +
-</code> +
- +
-As the starting script, since i use OpenRC, i have written the following init script wihch needs to be dropped to **/etc/init.d/filebrowser**: +
-<file filebrowser>+
 #!/sbin/openrc-run #!/sbin/openrc-run
 # Copyright 2024 Willy Garidol # Copyright 2024 Willy Garidol
Line 77: Line 69:
 } }
  
-FB_LOG_PATH="/var/log/filebrowser" +CC_SLOT="${SVCNAME#cloudcmd.}" 
-FB_SLOT="${SVCNAME#filebrowser.}" +CC_USER=${USER:-${CC_SLOT}} 
-FB_USER=${USER:-${FB_SLOT}} +CC_GROUP=${GROUP:-${CC_SLOT}
-FB_GROUP=${GROUP:-${FB_SLOT}}+CC_PACKER=${PACKER:-zip}
  
-description=${DESCRIPTION:-Web based Filebrowser}+description=${DESCRIPTION:-Cloud based filebrowser}
 pidfile="/run/${RC_SVCNAME}.pid" pidfile="/run/${RC_SVCNAME}.pid"
 command_background=true command_background=true
-command="/data/daemons/filebrowser/bin/filebrowser+command="/data/daemons/filebrowser/.npm_install/bin/cloudcmd
-command_args="-r \"${FOLDER}\" -${PORT} -\"${BASE_URL}\" -d \"${DATABASE}\" -${FB_LOG_PATH}/${FB_SLOT}/filebrowser.log+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="${FB_USER}:${FB_GROUP}"+command_user="${CC_USER}:${CC_GROUP}"
  
 start_pre() { start_pre() {
-        if [ "${FB_SLOT}" != "filebrowser" ]+        if [ "${CC_SLOT}" = "cloudcmd" ]
         then         then
-                test -e "${FB_LOG_PATH}" || mkdir "${FB_LOG_PATH}" 
-                test -e "${FB_LOG_PATH}/${FB_SLOT}" || { 
-                        mkdir "${FB_LOG_PATH}/${FB_SLOT}" 
-                } && chown -R ${FB_USER} "${FB_LOG_PATH}/${FB_SLOT}" 
-        else     
                 ebegin "Error: do not run this script, run a link to it!"                 ebegin "Error: do not run this script, run a link to it!"
                 eend 255                 eend 255
Line 105: Line 92:
 make it executable! make it executable!
  
-Now, create a file **/etc/conf.d/filebrowser.myshare**:+Now, create a file **/etc/conf.d/cloudcmd.myshare**:
 <file filebrowser.myshare> <file filebrowser.myshare>
 BASE_URL="/files/MyFiles" BASE_URL="/files/MyFiles"
-DATABASE="/homr/myuser/filebrowser.db" 
 DESCRIPTION="Common web archive" DESCRIPTION="Common web archive"
 FOLDER="/data/MyFiles" FOLDER="/data/MyFiles"
Line 114: Line 100:
 PORT=3005 PORT=3005
 USER="filebrowser" USER="filebrowser"
 +PACKER="zip" # or "tar"
 </file> </file>
  
 And create the symlink, start it and add to autostart: And create the symlink, start it and add to autostart:
 <code bash> <code bash>
-ln -s /etc/init.d/filebrowser  /etc/init.d/filebrowser.myshare +ln -s /etc/init.d/cloudcmd  /etc/init.d/cloudcmd.myshare 
-rc-update add filebrowser.myshare default +rc-update add cloudcmd.myshare default 
-/etc/init.d/filebrowser.myshare start+/etc/init.d/cloudcmd.myshare start
 </code> </code>
  
-To add more shares, just create new links to the //filebrowser// init script and create the associated config file.+To add more shares, just create new links to the //cloudcmd// init script and create the associated config file.
  
  
 ==== Updates ==== ==== Updates ====
  
-Download a new binary release (see link above), replace binary and restart service.+<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