Skip to content
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

No support of default sites-available/sites-enabled logic #11

Open
Soul6in6Gun opened this issue Jun 23, 2020 · 4 comments
Open

No support of default sites-available/sites-enabled logic #11

Soul6in6Gun opened this issue Jun 23, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request
Projects

Comments

@Soul6in6Gun
Copy link

Title says it all - tool searches default and common conf.d dir for webhost config but ignores typical debian\ubuntu's config dir of sites-available with symlinks in sites-enabled. I bet this is simple thing to add (probably this should be customizable for many other cases).

@kennyparsons
Copy link

kennyparsons commented Jun 24, 2020

Adding to this: I dont use the sites-available/sites-enabled logic, but rather simple folders of the different .conf files. The folders are almost like categories: php sites, static web servers, proxy sites, etc. So it seems there needs to be some logic built in.

As a proposed solution: nginx itself already has this logic when it builds the configuration. The output of nginx -T will show every site enabled to be served up with the path to the configuration file. Here's a snippet of mine:

# configuration file /etc/nginx/conf.d/php/files.techup.dev.conf:
    server {
        listen                  80;
        #items omitted
        location ~ \.php$ {
            fastcgi_pass        unix:/run/php/php7.3-fpm.sock;
            include             fastcgi_params;
            fastcgi_param       SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param       SCRIPT_NAME $fastcgi_script_name;
        }
    }

As you can see here, by parsing the output of nginx -T, we can very easily get the absolute path of every config file used. The great part is that it would be user agnostic. @Soul6in6Gun and I have different methods to organize our .conf files, but parsing the nginx compiled configuration would work for both of us, without modification.

@Soul6in6Gun
Copy link
Author

Yeah, this thing could be parsed from configs itself. Although even simple manual option "check this path for webhost config" is enough for many cases imo - this covers up our requests.

@schenkd schenkd added the enhancement New feature or request label Jun 25, 2020
@schenkd schenkd self-assigned this Jun 25, 2020
@schenkd
Copy link
Owner

schenkd commented Jun 25, 2020

Hello @Soul6in6Gun and @kennyparsons, these are a very good points!

I hear two things from this discussion:

Point 1: is the way available and enabled sites are managed is different. In your example it uses the well-known separation of two different directories which is also known from the Apache web server. This is because I currently only support the nginx type structure. I could implement both logics and have them controlled by an environment variable/or other parameter.

Point 2: is the use of subdirectories for the organization of pages etc. This is another problem I can solve by adjusting the way such files are looked at. Should both be feasible and will be worked out by me in the next release.

Have I understood your requirements correctly?

Best David

@kennyparsons
Copy link

I think so.

@schenkd schenkd added this to In progress in Version 0.3 Jun 28, 2020
@schenkd schenkd moved this from In progress to Done in Version 0.3 Jun 28, 2020
@schenkd schenkd moved this from Done to In progress in Version 0.3 Jun 28, 2020
@schenkd schenkd removed this from In progress in Version 0.3 Jun 28, 2020
@schenkd schenkd added this to To do in Version 0.3 Jun 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Version 0.3
  
To do
Development

No branches or pull requests

3 participants