Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| services:cloudcommander [2025/01/21 12:14] – willy | services:cloudcommander [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Cloud Commander ====== | ||
| - | |||
| - | [[http:// | ||
| - | |||
| - | ===== Installation ===== | ||
| - | |||
| - | 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> | ||
| - | useradd -d / | ||
| - | </ | ||
| - | |||
| - | See [[gentoo: | ||
| - | |||
| - | Then, install CloudCommander: | ||
| - | <code bash> | ||
| - | su - cloudcmd | ||
| - | npm i cloudcmd -g | ||
| - | </ | ||
| - | |||
| - | 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 ===== | ||
| - | |||
| - | 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 ===== | ||
| - | |||
| - | cloudcmd --packer zip --root / | ||
| - | |||
| - | |||
| - | |||
| - | ==== Running ==== | ||
| - | |||
| - | 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=" | ||
| - | |||
| - | |||
| - | echo $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 | ||
| - | </ | ||
| - | |||