Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
services:cloudcommander [2025/01/21 07:28] – created willy | services:cloudcommander [2025/01/21 12:58] (current) – willy | ||
---|---|---|---|
Line 5: | Line 5: | ||
===== Installation ===== | ===== Installation ===== | ||
- | As usual, you will want to install | + | 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 / | + | useradd -d / |
</ | </ | ||
Line 18: | Line 19: | ||
</ | </ | ||
+ | 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: | ||
+ | < | ||
+ | export UMASK=0002 | ||
+ | </ | ||
===== 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:// | ||
+ | proxy_http_version 1.1; | ||
+ | |||
+ | proxy_set_header Connection $http_connection; | ||
+ | proxy_set_header Connection ' | ||
+ | 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; | ||
+ | |||
+ | } | ||
+ | </ | ||
+ | |||
+ | 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 ===== | ||
+ | |||
+ | You can run it by hand with the following example line: | ||
+ | <code bash> | ||
+ | cloudcmd --packer zip --root / | ||
+ | </ | ||
+ | |||
+ | 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 **/ | ||
+ | <file cloudcmd> | ||
+ | # | ||
+ | # Copyright 2024 Willy Garidol | ||
+ | # Distributed under the terms of the GNU General Public License v3 | ||
+ | |||
+ | depend() { | ||
+ | need localmount net | ||
+ | } | ||
+ | |||
+ | CC_SLOT=" | ||
+ | CC_USER=${USER: | ||
+ | CC_GROUP=${GROUP: | ||
+ | CC_PACKER=${PACKER: | ||
+ | |||
+ | description=${DESCRIPTION: | ||
+ | pidfile="/ | ||
+ | command_background=true | ||
+ | command="/ | ||
+ | command_args=" | ||
+ | command_user=" | ||
+ | |||
+ | start_pre() { | ||
+ | if [ " | ||
+ | then | ||
+ | ebegin " | ||
+ | eend 255 | ||
+ | fi | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | make it executable! | ||
+ | |||
+ | Now, create a file **/ | ||
+ | <file filebrowser.myshare> | ||
+ | BASE_URL="/ | ||
+ | DESCRIPTION=" | ||
+ | FOLDER="/ | ||
+ | GROUP=" | ||
+ | PORT=3005 | ||
+ | USER=" | ||
+ | PACKER=" | ||
+ | </ | ||
+ | |||
+ | And create the symlink, start it and add to autostart: | ||
+ | <code bash> | ||
+ | ln -s / | ||
+ | rc-update add cloudcmd.myshare default | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | To add more shares, just create new links to the // | ||
+ | |||
+ | |||
+ | ==== Updates ==== | ||
+ | |||
+ | <code bash> | ||
+ | npm u cloudcmd | ||
+ | </ | ||
+ | |||