-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Evan D Shaw
committed
Jul 11, 2022
1 parent
2a6947d
commit dabc7e2
Showing
11 changed files
with
190 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { SSH } from "./utils.mjs"; | ||
|
||
/** | ||
* Configures SSL | ||
*/ | ||
export const finalize = (config) => { | ||
const client = new SSH(config); | ||
|
||
const commands = []; | ||
commands.push(`kusanagi configure --fqdn ${config.domain} ${config.rootsite.profile};`); | ||
commands.push(`kusanagi ssl --email ${config.email} --https redirect --auto on ${config.rootsite.profile};`); | ||
|
||
[config.rootsite, ...config.subsites].forEach((site) => { | ||
let url = `https://${config.domain}`; | ||
if (site.path && site.path.length > 0) { | ||
url = `${url}/${site.path}`; | ||
} | ||
|
||
commands.push(`cd /home/kusanagi/${site.profile}/DocumentRoot;`); | ||
commands.push( | ||
`wp option get home | xargs -I{} wp search-replace {} ${url};` | ||
); | ||
commands.push( | ||
`wp option get siteurl | xargs -I{} wp search-replace {} ${url};` | ||
); | ||
}) | ||
|
||
commands.push(`kusanagi nginx --reload;`); | ||
|
||
client.sshKusanagi(commands.join(' ')); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env node | ||
import { getCredentialsConfig } from './config.mjs'; | ||
import { finalize } from './finalize.mjs'; | ||
|
||
const config = getCredentialsConfig(); | ||
finalize(config); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/usr/bin/env node | ||
import { getConfig } from './config.mjs'; | ||
import { getCredentialsConfig } from './config.mjs'; | ||
import { nginxConfigure } from './nginx-configure.mjs'; | ||
|
||
const config = getConfig(); | ||
const config = getCredentialsConfig(); | ||
nginxConfigure(config); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/usr/bin/env node | ||
import { getConfig } from './config.mjs'; | ||
import { getCredentialsConfig } from './config.mjs'; | ||
import { provision } from './provision.mjs'; | ||
|
||
const config = getConfig(); | ||
const config = getCredentialsConfig(); | ||
provision(config); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
#!/usr/bin/env node | ||
import { getConfig } from './config.mjs'; | ||
import { getConfig, getCredentialsConfig } from './config.mjs'; | ||
import { ec2Init } from './ec2-init.mjs'; | ||
import { provision } from './provision.mjs'; | ||
import { wpInstall } from './wp-install.mjs'; | ||
import { nginxConfigure } from './nginx-configure.mjs'; | ||
|
||
const config = getConfig(); | ||
ec2Init(config, () => { | ||
provision(config); | ||
wpInstall(config); | ||
provision(getCredentialsConfig()); | ||
wpInstall(getCredentialsConfig()); | ||
nginxConfigure(getCredentialsConfig()); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/usr/bin/env node | ||
import { getConfig } from './config.mjs'; | ||
import { getCredentialsConfig } from './config.mjs'; | ||
import { wpInstall } from './wp-install.mjs'; | ||
|
||
const config = getConfig(); | ||
const config = getCredentialsConfig(); | ||
wpInstall(config); |