Skip to content

Commit

Permalink
Move share link from nginx.conf to nginxconfig.txt (digitalocean#395)
Browse files Browse the repository at this point in the history
* ✨ feat: external shared link

* ✅ chore: apply eslint

* Update src/nginxconfig/generators/index.js

Co-authored-by: Matt Cowley <me@mattcowley.co.uk>

* Update src/nginxconfig/generators/conf/nginx.conf.js

Co-authored-by: Matt Cowley <me@mattcowley.co.uk>

Co-authored-by: Matt Cowley <me@mattcowley.co.uk>
  • Loading branch information
MrJmpl3 and MattIPv4 authored Oct 4, 2022
1 parent 400911d commit 4fabd0c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/nginxconfig/generators/conf/nginx.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@ THE SOFTWARE.

import sslProfiles from '../../util/ssl_profiles';
import websiteConf from './website.conf';
import shareQuery from '../../util/share_query';

export default (domains, global) => {
const config = {};

// Source
config['# Generated by nginxconfig.io'] = '';
const query = shareQuery(domains.map((domain, index) => [domain, index]).filter(d => d[0] !== null), global);
config[`# ${window.location.protocol}//${window.location.host}${window.location.pathname}${query}`] = '';
config['# See nginxconfig.txt for the configuration share link'] = '';

// Basic nginx conf
config.user = global.nginx.user.computed;
Expand Down
4 changes: 4 additions & 0 deletions src/nginxconfig/generators/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import magentoConf from './conf/magento.conf';
import joomlaConf from './conf/joomla.conf';
import dockerComposeYaml from './yaml/dockerCompose.yaml';
import dockerConf from './ext/docker';
import shareQuery from '../util/share_query';

export default (domains, global) => {
const files = {};
Expand Down Expand Up @@ -106,5 +107,8 @@ export default (domains, global) => {
files['nginxconfig.io/php_fastcgi.conf'] = toConf(phpConf(domains));
}

const query = shareQuery(domains.map((domain, index) => [domain, index]).filter(d => d[0] !== null), global);
files['nginxconfig.txt'] = `${window.location.protocol}//${window.location.host}${window.location.pathname}${query}`;

return files;
};

0 comments on commit 4fabd0c

Please sign in to comment.