From 98dbcca874c664cea5b6dc4b1c68e4c505444847 Mon Sep 17 00:00:00 2001 From: sami616 Date: Fri, 8 Dec 2017 18:00:27 +0000 Subject: [PATCH] Added Yoast to plugins list Added Wordpress Auth Salt Generation Added Success Notification Upped Version to 0.1.1 --- package.json | 3 ++- src/actions/wpActions.js | 11 ++++++++++- src/components/screens/End.js | 4 ++++ src/components/screens/Wordpress.js | 4 ++-- src/reducers/pluginReducer.js | 9 +++++++++ yarn.lock | 4 ++++ 6 files changed, 31 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 7a4a814..bd7c663 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "APL", "description": "Advanced Project Launcher", "author": "srdesigns", - "version": "0.1.0", + "version": "0.1.1", "private": true, "main": "electron/index.js", "homepage": "./", @@ -11,6 +11,7 @@ "electron-updater": "^2.16.1", "express": "^4.16.2", "firebase": "^4.6.2", + "node-jen": "^1.0.6", "polished": "^1.9.0", "react": "^16.0.0", "react-dom": "^16.0.0", diff --git a/src/actions/wpActions.js b/src/actions/wpActions.js index 2a21514..a9503e9 100644 --- a/src/actions/wpActions.js +++ b/src/actions/wpActions.js @@ -2,6 +2,8 @@ const path = window.require('path'); const fs = window.require('fs'); const request = window.require('request'); const unzip = window.require('unzip'); +const Jen = window.require('node-jen'); +const hdl = new Jen(true); export const check = e => { @@ -41,7 +43,7 @@ export const downloadWP = () => { return (dispatch, getState) => { const { yearPath, wordpressPath } = getState().setup.paths; - const { renameConfig, dbPrefix, dbName, dbUser, dbPass, dbHost } = getState().wp + const { renameConfig, dbPrefix, dbName, dbUser, dbPass, dbHost, generateAuth } = getState().wp const zipPath = path.join(yearPath, 'wp.zip'); @@ -102,6 +104,13 @@ export const downloadWP = () => { result = result.replace('password_here', dbPass); result = result.replace('localhost', dbHost); + if(generateAuth){ + for(let s=0; s<=8; s++){ + result = result.replace('put your unique phrase here', hdl.password(64,64)); + } + + } + fs.writeFile(wpConfigPath, result, 'utf8', function (err) { if (err) { return console.log(err) } }); diff --git a/src/components/screens/End.js b/src/components/screens/End.js index c247e25..c5c6cfb 100644 --- a/src/components/screens/End.js +++ b/src/components/screens/End.js @@ -11,6 +11,10 @@ class End extends Component { app.quit(); } + componentDidMount(){ + new Notification('Success', { body: 'Project initialized' }); + } + render() { return ( diff --git a/src/components/screens/Wordpress.js b/src/components/screens/Wordpress.js index fdc6a26..f0442a5 100644 --- a/src/components/screens/Wordpress.js +++ b/src/components/screens/Wordpress.js @@ -48,12 +48,12 @@ class Wordpress extends Component {