To make startup of pupcloud easier we can use a config file #26
Replies: 7 comments
-
I feel you're right 😬; it was a conscious design decision to try and do without any kind of database, dotfile or config file... right or not, I wanted to play within the constraint and see what I can still do. To address your issue: from version 0.8.0 pupcloud there is support for env variables. They can be used to write a "rich" shell script that looks like a config file, maybe? Something like: export PUP_ROOT=/home/user/Share/pubcloud
export PUP_PWD_HASH=1234567890abcde...
export PUP_MAX_UPLOAD_SIZE=128
export PUP_ALLOW_EDITS=1
export PUP_SHARE_PROFILES=John:S3cr3t,James:S5cr5t
export PUP_SHARE_PREFIX=http://domain.com:12345/pupshare
export PUP_FOLLOW_SYMLINKS=1
./pupcloud You need to PUP_ROOT=/home/user/Share/pubcloud \
PUP_PWD_HASH=1234567890abcde... \
PUP_MAX_UPLOAD_SIZE=128 \
PUP_ALLOW_EDITS=1 \
PUP_SHARE_PROFILES=John:S3cr3t,James:S5cr5t \
PUP_SHARE_PREFIX=http://domain.com:12345/pupshare \
PUP_FOLLOW_SYMLINKS=1 \
./pupcloud |
Beta Was this translation helpful? Give feedback.
-
I wrote some docs reflecting this discussion, thanks. |
Beta Was this translation helpful? Give feedback.
-
I thought it would be difficult using env variables, but with your documentation it was easy. I have already made a bash file to use with the next release of pupcloud. Only the user that sets the env variables can change them right? (except for root obviously) |
Beta Was this translation helpful? Give feedback.
-
Good to hear! Nice.
I am not a sysadmin, so I don't really know for sure; what I can tell you is that, in pupcloud's code, the env vars get copied at startup into local variables, so even if they changed value after startup it wouldn't matter. Also, the second form I mentioned directly "pipe" the vars in the command, so it's much more difficult (impossible?) to change them. It's an atomic operation, so to speak. |
Beta Was this translation helpful? Give feedback.
-
export PUP_ROOT=/path Works PUP_ROOT=/path \ Does not work for me |
Beta Was this translation helpful? Give feedback.
-
The sense of the second "form" is that this works: PUP_ROOT=/path ./pupcloud It basically defines a variable for the command that follows it. In bash at least (I don't know other shells) the character PUP_ROOT=/path \
./pupcloud Take care to avoid spaces after the |
Beta Was this translation helpful? Give feedback.
-
I typed it all again and now it works. Must have been that rogue space you wrote about. thank you. |
Beta Was this translation helpful? Give feedback.
-
When I first used pupcloud I started it with
pupcloud -r /home/user/pupcloud
That is easy and relatively quick to type.
After some experimenting with pupcloud my startup line evaluated to
pupcloud -r /home/user/Share/pubcloud -H 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef --max-upload-size 128 -E --share-profile John:S3cr3t --share-profile James:S5cr5t --share-prefix 'http://domain.com:12345/pupshare' --follow-symlinks
This is a bit much to type .............
ENHANCEMENT: wouldn't it be nice to ha a config file (pupcloud.conf) to start pupcloud.
pupcloud might be started with: pupcloud -c pupcloud.conf
option -c is config.file
Beta Was this translation helpful? Give feedback.
All reactions