Sunteți pe pagina 1din 6

AppKodes Development Team

Hitasoft Technology Solutions Private Limited


Digital Market Place: ​https://appkodes.com
Corporate website: ​www.hitasoft.com

Hiddy - Server Installation

Script: Hiddy v1.1


AppKodes Development Team
Hitasoft Technology Solutions Private Limited
Digital Market Place: ​https://appkodes.com
Corporate website: ​www.hitasoft.com

1. Introduction

Following this document would demonstrate the steps involved in manual installation of the
hiddy script.

Upload the source to your HOME directory or any directory in your server & unzip it.

2. Set API URL


Update the api url in /src/environments/environment.prod.ts &
/src/environments/environment.ts files.

API_URL : ​“YOUR SERVER URL HERE”,

Ex : ​https://localhost:3000

3. Create a new database & collections in mongodb.

a. Create new database & collections in mongodb by executing the following commands

● Your database name in place of ​databasename​​.

Use databasename;

Admin:
db.createCollection("admin");
db.admin.insert({
"name": "Admin",
"username": "admin@hiddy.com",
"password":
"$2y$12$j1kn/RDr4C.VbdWg63IFQesIaFH/9mv706NfUi1hRXdTiIeK/bUfm"
});
AppKodes Development Team
Hitasoft Technology Solutions Private Limited
Digital Market Place: ​https://appkodes.com
Corporate website: ​www.hitasoft.com

Sitesettings:
db.createCollection("sitesettings");
db.sitesettings.insert({
"site_title" : "Hiddy",
"banner_image" : "banner.png",
"logo" : "logo.png",
"sliders" : [
"slider_image1.png",
"slider_image2.png",
"slider_image3.png",
"slider_image4.png"
],
"banner_text" : "Say hi' to your buddies\n",
"footer_text" : "Appkodes.com @2018 ",
"fcm_key" :
"AAAAxlqooK0:APA91bE1_5sLr-uXa8o9FsOmxT85zbCeOl4TMGVuvhkBzHb8nwPKa_
G2rNkfEXdA5TdEydWukLwsu0B5EhwnT1EQHKRbLBWxFuvLtHQnzk2a_BHK0br3ZPI
AUyC5MuWU8vGBycBrwRyAO36h_HNVrJvT6wmUGaU2UQ",
"android_store" :
"https://play.google.com/store/apps/details?id=com.hitasoft.app.hiddy",
"facebook_link" : "https://www.facebook.com/appkodes",
"google_link" : "https://plus.google.com/+Appkodesclonescript",
"ios_store" : "https://itunes.apple.com/us/app/hiddy/id1421087138?mt=8",
"twitter_link" : "https://twitter.com/appkodes",
"voip_passpharse" : "HIDDY2018",
"android_update" : 0,
"android_version" : "1",
"ios_update" : 0,
"ios_version" : "1"
});
AppKodes Development Team
Hitasoft Technology Solutions Private Limited
Digital Market Place: ​https://appkodes.com
Corporate website: ​www.hitasoft.com

Helps:

db.createCollection("helps");
db.helps.insert({
"title" : "Privacy Policy",
"type" : "terms",
"description" : "<p><strong>Sharing data</strong></p><p><em>We never share
your data with anyone. To this day, we have disclosed 0 bytes of user data to third
parties, including governments.</em></p><p><br></p><p><strong>Storing
data</strong></p><p><em>Hiddy only stores the data it needs to function properly —
for as long as you want Hiddy to
function.</em></p><p><br></p><p><strong>Chats</strong></p><p><em>Hiddy
is a cloud service. We store messages, photos, videos and documents from your cloud
chats on our servers, so that you can access your data from any of your devices anytime
and use our instant server search to quickly access your messages from way
back.</em></p><p><br></p><p><strong>Media in
Chats</strong></p><p><em>When you send photos, videos or files via chats, before
being uploaded, each item is encrypted with a separate key, not known to the server. This
key and the file’s location are then encrypted again, this time with the secret chat’s key
— and sent to your recipient. He can then download and decipher the file. This means
that the file is technically on one of Hiddy’s servers, but it looks like a piece of random
indecipherable garbage to everyone except for you and the recipient. We don’t know
what this random data stands for and we have no idea which particular chat it belongs
to. We periodically purge this random data from our servers to save disk
space.</em></p><p><br></p><p><strong>Contacts:</strong></p><p><em>Hidd
y uses phone numbers as unique identifiers, so that it is easy for you to switch from other
messaging apps and retain your social graph. We ask your permission before syncing
your contacts.</em></p><p><em>We store your contacts in order to notify you as
soon as one of your contacts signs up for Hiddy and to properly display names in
notifications. We only need the number and name (first and last) for this to work and
store no other data about your
contacts.</em></p><p><br></p><p><strong>Permission</strong></p><p><em>
Hiddy needs a permission for Camera, Record Audio, Contacts and other permission
only for access your needs. We don't share any of this information to any third
parties.</em>&nbsp;</p>"
});
AppKodes Development Team
Hitasoft Technology Solutions Private Limited
Digital Market Place: ​https://appkodes.com
Corporate website: ​www.hitasoft.com

4. Update the database & port information


a. Now you have to update the information in /server/keys.js

For Example:

module.exports = {
mongoURI: '​MONGO CONNECTION URL​’',
secret: '*****', Example: “KEY TO BE USED ON PASSWORD ENCRYPTION”
redisPassword: '*****' ​ Example: “REDIS PASSWORD”
apiPort: '*****' Example:​ “3000”
socketPort: '*****' ​Example: “4000”
}

4. Node Modules dependencies installation


Now you have to install node_modules dependencies in the unzipped folder by executing the
following commands & will get build in ​DIST​​ folder at end of execution.

npm install
npm install -g @angular/cli (angular client )
ng build --prod
ng build --prod --build-optimizer
npm install forever -g
sudo forever start -c "npm start" ./

For more reference: ​https://angular.io/guide/deployment

5. ​ ​Move your build to apache or nginx directory

Copy all files from dist/ folder , Now you have to paste all the files in the path /var/www/html/
(apache2) or (/var/www/your domain name)
AppKodes Development Team
Hitasoft Technology Solutions Private Limited
Digital Market Place: ​https://appkodes.com
Corporate website: ​www.hitasoft.com

6. SSL Configuration
i) Enable SSL in both the files hiddy.js & /server/routes/chat.js.
Change this variable const httpsMode = "disable"; to const httpsMode = "enable";
ii) Update your ssl key file & certificate path in in both the files hiddy.js & /server/routes/chat.js.
const privateKey = fs.readFileSync('');
const certificate = fs.readFileSync('');
const ca = fs.readFileSync('');

7. Create .htaccess file


Paste the below content in htaccess file in dist/folder
RewriteEngine On
# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]
# If the requested resource doesn't exist, use index.html
RewriteRule ^ /index.html

Now you have successfully completed the installation.


Load the siteurl in the browser.

S-ar putea să vă placă și