Are jekyll projects in directories that are not owned by jekyll user possible?


Happy to be here.

As it says in the headline, I am a bit lost in how to structurize my projects that are realized with jekyll.

At this point, I have structured my projects within /var/www, so I have /var/www/domain1.tld/documentation, /var/www/domain1.tld/bootstrap and of course /var/www/domain1.tld/jekyll. At least this is, what it is supposed to be.

Every domain.tld has its own user which is owner of the directory structure, all of them are non-sudo users and are set with chmod 2755, so an example looks like this:

drwxr-sr-x  4 domain1.tld          domain1.tld          4096 Mai 27 20:55 domain1.tld

The SGID was an attempt to bring my $SUDOUSER to be able to call for jekyll in the directory, but that did not work. I would highly like to avoid setting any higher user permissions in this.

Any ideas? How do you structure your stuff? I am thinking about a jekyll user as well to solely collect all the jekyll projects in that.

Looking forward to reading from you!


is this on an actual web server?

I would guess most people just have a folder on their local computer with a repos folder or something, and then each website is in a sub folder of that and then using git to push/pull to GH or BB. I use the same login as my normal computer user.

It sounds like you are setting this all up on a webserver and thus want separate usernames to control access better? that would seem difficult to manage especially given how easy it is to host via AWS amplify or vercel or any number of other services that sync with your git repo and publish on any change.

If you are running your own server and want to host like that I would still probably have the jekyll part separate and just sync the _site folders to your webserver.

You may want to add more details on what you are trying to achieve.

Yes, this is an actual webserver running with nginx/1.14.2.

My original intention was to create one user per TLD, thus subdirectories of this users root directory are created to serve different services, e.g. a jitsi server (jitsi.domain.tld), a jekyll blog (jekyll.domain.tld), a nextcloud solution (nextcloud.domain.tld), a fastapi webapp (fastapi.domain.tld), you get the idea.

Seems like this is not possible with jekyll and the approach is more that I will have to collect all the domains under the service of jekyll, e.g. /srv/jekyll/{domain1.tld, domain2.tld, domain3.tld} and so on and so forth, am I correct here?

It does seem that I am able to start jekyll within the target users directory, but an error pops up as soon as jekyll tries to write files (only allowed for owner of the directory).

Let’s see if there is a way to doodle around this error, but in case it is not possible (without giving up reasonable directory permissions), I can live with the jekyll-as-a-user solution as well.

Alright, I guess I have figured it out. Jekyll is not intended to be installed on production servers at all. Thus, all I am doing with Jekyll happens on my local machine and everything it creates is going to be uploaded to the production server.

Time to feel dumb. Thanks for your effort though.