-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom skeleton environmental variable #1831
Comments
hi there, You can always add your own ones using a custom dockerfile. You can get an inspiration by the files that are currently bundled into the docker image here. <?php
$CONFIG = array (
'trashbin_retention_obligation' => getenv('TRASH_RETENTION'),
); You can see the use of the function FROM nextcloud:fpm-alpine
COPY config/my-cool-custom-config.config.php /usr/src/nextcloud/config/ Please note that the nextcloud docker file only copies the config files once. This means the first run of the container will copy the files from Than build your own docker image or let compose do so and you're good to go. If you don't need a custom docker image that can reproduicably be used to setup your NC instance you can also just add the custom config.php into the config directory and don't need to build your own image. |
Oh, I don't really know much about this other than the pretty easy work-around to change one line in the config.php file that I get from a persistent volume. Then as mentioned earlier I set the following line: 'skeletondirectory' => false, This is exactly how the other env variables work too. They just change a string in the config.php. That's why I though it was an easy task. |
Configuring the server through the config.php is an expected task and not a workarround. It's fully normal to do so.
The readme says that configuration through env's is only implemented for some basic configuration options. If you only need this for one deployment just edit the config.php as this is the normal way to do so. If you ceed a reproduicible way to automatically setup the serer config (maybe some automation or so) you should use a custom Dockerfile ;) here's also a comment by a dev:
|
Judging by this nextcloud/server#3966 it should be possible to configure settings from config.php through environment variables by prefixing with NC_ |
And also I don't really understand what's the point of having default skeleton directory provided by next cloud? The chance is that 99% of people will either want to put their own skeleton directories or start without any files. Having some random pictures and videos is just annoying... Wouldn't it be more natural to start off with empty directory by default with possibility to specify your own skeleton directory if needed ? |
Direct support is not going to get added to the image because there are already plenty of ways to set additional config parameters these days:
|
Like @k0dard mentioned earlier:
I just tried both using uppercase WorkaroundI managed to workaround this problem by using the auto-config hooks like @joshtrichards mentioned. This was done by:
volumes:
#available options: pre-installation,post-installation,pre-upgrade,post-upgrade,before-starting
- PATH_TO_SCRIPT/disableSkeletonPath.sh:/docker-entrypoint-hooks.d/before-starting/disableSkeletonPath.sh
echo 'php occ config:system:set skeletondirectory --value="" --type=string' | sudo tee PATH_TO_SCRIPT/disableSkeletonPath.sh
sudo chmod +x PATH_TO_SCRIPT/disableSkeletonPath.sh An important thing to note is that this isn't applied for the default admin account, as it seems like it gets all the skeletonfiles during installation of nextcloud. However, all the users that are created after the initial installation seems to not have any skeletonfiles, like expected. Resources |
Thanks, @NorskNoobing, for following up on this.
e.g.
Results in, after visiting the web installer url, an install w/o my initial admin account have the default skeleton contents from Note that it won't appear in your P.S. Let's try to boost the documentation a bit in this area: |
Oh, I see. It works more like a override, rather than writing to the config file, like how I thought it was working. I just tried with uppercase The composefile would then be: ...
environment:
- NC_skeletondirectory=
... I tried both using the default admin account and a manually created account, and both of them are missing the skeletonfiles, as expected. Thanks to everyone for the contribtion in this issue! @joshtrichards Did you want me to create and provide some docs on this, or was it just to cross-reference the issues? |
Yeah I believe the case sensitivity (which probably feels a little odd if standing next to the Docker image handled environment variables) is because the Glad to hear you got it working better for you!
A bit of both. :-) So, yes, to your first question: if want to get the ball rolling that would really be helpful! |
Description
I would want an environmental variable in the docker image that allows you to set the
skeletondirectory
property in theconfig.php
file.This would work by implementing the same property as described in the config.php parameters documentation.
Examples
The following are examples of how this feature could be implemented.
Example 1:
Disable skeleton directory
Which would add the following to the
config.php
file.Example 2:
Define a custom skeleton directory path
Which would add the following to the
config.php
file.The text was updated successfully, but these errors were encountered: