Skip to content

Commit

Permalink
✨ Add kutt.it as a url shortner option. Used for sharing configurations.
Browse files Browse the repository at this point in the history
  • Loading branch information
jolzee committed Feb 23, 2020
1 parent c9a4702 commit 15af084
Show file tree
Hide file tree
Showing 5 changed files with 1,537 additions and 1,506 deletions.
43 changes: 22 additions & 21 deletions .env
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
VUE_APP_BUILD_COMPRESS_JAVASCRIPT_ASSETS=true
VUE_APP_BUILD_COMPRESS_CSS_ASSETS=true
VUE_APP_EMBED_KILL_SESSION_ON_CLOSE=false
VUE_APP_FIREBASE_API_KEY=
VUE_APP_FIREBASE_AUTH_DOMAIN=
VUE_APP_FIREBASE_DATABASE_URL=
VUE_APP_FIREBASE_MESSAGING_SENDER_ID=
VUE_APP_FIREBASE_PROJECT_ID=
VUE_APP_FIREBASE_STORAGE_BUCKET=
VUE_APP_GET_STATIC_DEFAULT_CONFIG=false
VUE_APP_HIDE_CONFIG_MENU=false
VUE_APP_LIVE_CHAT_AGENT_ASSIST_SERVER=
VUE_APP_LIVE_CHAT_INC_KEY=
VUE_APP_LOAD_FRESH_CONFIG_FOR_NEW_SESSIONS=false
VUE_APP_LOCATION_IQ_KEY=
VUE_APP_LOG_ROCKET=
VUE_APP_PUSHER_KEY=
VUE_APP_SENTRY_DSN=
VUE_APP_SOLUTION_CONFIG_FILE=.env.solution.json
VUE_APP_SOURCE_MAP=false
VUE_APP_HIDE_AS_BRANDING=false
VUE_APP_BUILD_COMPRESS_JAVASCRIPT_ASSETS=true
VUE_APP_BUILD_COMPRESS_CSS_ASSETS=true
VUE_APP_EMBED_KILL_SESSION_ON_CLOSE=false
VUE_APP_FIREBASE_API_KEY=
VUE_APP_FIREBASE_AUTH_DOMAIN=
VUE_APP_FIREBASE_DATABASE_URL=
VUE_APP_FIREBASE_MESSAGING_SENDER_ID=
VUE_APP_FIREBASE_PROJECT_ID=
VUE_APP_FIREBASE_STORAGE_BUCKET=
VUE_APP_GET_STATIC_DEFAULT_CONFIG=false
VUE_APP_HIDE_CONFIG_MENU=false
VUE_APP_LIVE_CHAT_AGENT_ASSIST_SERVER=
VUE_APP_LIVE_CHAT_INC_KEY=
VUE_APP_LOAD_FRESH_CONFIG_FOR_NEW_SESSIONS=false
VUE_APP_LOCATION_IQ_KEY=
VUE_APP_LOG_ROCKET=
VUE_APP_PUSHER_KEY=
VUE_APP_SENTRY_DSN=
VUE_APP_SOLUTION_CONFIG_FILE=.env.solution.json
VUE_APP_SOURCE_MAP=false
VUE_APP_HIDE_AS_BRANDING=false
VUE_APP_KUTT_IT_API_KEY=
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
- secure: Fb0DilEJ862wobrfbO/9tqCfap7gmmUQyUZLx6g9QDsCv/pq7yEeBmOWZT1ld8Praw0rdPSs7r+sgoLqvfYyaBA58bvCkk7HtP6ANuDVH+LKG9z6ThL3ehuS0FBbXTCrgaT77ZA5SJu1ReDlEWRl6SU/lnCyDeV+ZJxOG2lRduDAuYGT9aKH6YVbsjT7mAuQMZPyfp3mjMxeNDtu6Vs07hXbqyv70Usdert3X/NXIMeN2L+jWSBXXYAsLvhQNJ/uGG3mEgqcJInaCI68DIlNGkbgmymBrkbDj7Ii4K3nKu4mV4naTRScF5++eu7nHrzZ+aP3heBCLKY967aNZZiXh9nazvMXpMsSjFb2h4DCeMfMfMmsxIYM/FDtIZa5NxeggRe/8DgahHSaNyw9k60ur40dte8K+ef438jDAsXrIGWTUZlqf5KVOXiOHWOQ0uC0bB3t0heSpvbwvqsaXeU50Hmxn4mqGK4aGuPpGeU7EAFLXZdPvxRa0Zjaw1EAXBpmK430foTxmrcEIaTvjg+jM/b59wLFYcbACnHoouWos4CWKp5kMw2b1HX1Q0bBod3oJAZJL59lwC9nFpQj3p56M5wK9Ptd6VRSGuv8Lw2xiYtnN3fCYP/gsxpqeZFTFsH3MiSGwU7+9RF+4cS5RlXdiCwb7vjLV9qVeAIImL7m1Cw=
- secure: DUK7mtuIPxnjWlFkZJs1kMpqIgQwQtdee3HPBKRSvLLx99eHv5gFxJDfBjllJ5zJ6UqkTPuRFq23Z69m6ButxDgL4vJ0LKGXr1p/EOpB6LizKH7NKdH/A1ha6HLmkJI39w13uZGZUZ0BjF1KKlKEa79Jile+DiYJGgoayjhyJxVHubJ/0eJx0XdCr3mmFoHet85GncIqf77ohRyVi2dzzY1cFRS6hHb6nxkX6/8wLQmShuB2tuZNOFNA/EnB1D9NhQ1LOEiZLViCweHzt98la02tKH8e08wKA4RurxMkvNaYeVlQlBBDtQ1H/LXJbrQmMjLcNkncyAXWdvig51X5IF4xWHoKtLzK864t87X0PPBuIbZoWfxh3EX1FAdC9+XYIrHGZdbbwewB5QqJz4CYs1CdWrEiIlLO0LVKfxr0kJMR25Gu91Z1y78xlQc06Hc9skmmALNMpPDUQ1vHlzkvlLkgd4Alm6rinzYfJW2PWdAQOB6iNKd+pIH1qN7QWUBU0FKtKN3Z6iwzV6P0Z0FnH3RYC42g6pY+XmPKY1lgfkSlBw9IS3lvpcL2ddv3rXb2nN0o4hFvOl5o1SeDYWNqdeUOmqLDc2kOvrKYHTBoFaVF4T/0YmvUK+CdwKhn1nwqsUjQzoY41leD7Hqa73UWyQZ3i/Jf8lpTaCBjvf9zWu0=
before_install:
- openssl aes-256-cbc -K $encrypted_e0272ac8690c_key -iv $encrypted_e0272ac8690c_iv
- openssl aes-256-cbc -K $encrypted_54a1e4422a70_key -iv $encrypted_54a1e4422a70_iv
-in secrets.tar.enc -out secrets.tar -d
- tar xvf secrets.tar
install:
Expand All @@ -29,6 +29,7 @@ before_deploy:
- ssh-add deploy_rsa
deploy:
provider: script
script: rsync -r -e "ssh -o StrictHostKeyChecking=no" --delete-after --quiet ./dist/
script:
rsync -r -e "ssh -o StrictHostKeyChecking=no" --delete-after --quiet ./dist/
${SSH_USER}@${SSH_HOST}:/var/www/leopard-chat
edge: true
Binary file modified secrets.tar.enc
Binary file not shown.
97 changes: 49 additions & 48 deletions src/utils/leopardConfig.js
Original file line number Diff line number Diff line change
@@ -1,48 +1,49 @@
const environmentVariables = process.env;

const getEnvValue = (name, fallback = "") => {
let result = fallback;
if (name in environmentVariables && environmentVariables[name] !== "") {
result = environmentVariables[name];
if (result === "true") {
result = true;
} else if (result === "false") {
result = false;
}
}
return result;
};

export default {
isProduction: getEnvValue("NODE_ENV", "production") === "production",
killSessionOnCloseEmbed: getEnvValue("VUE_APP_EMBED_KILL_SESSION_ON_CLOSE", false),
solutionConfig: {
buildConfig: getEnvValue("VUE_APP_SOLUTION_CONFIG", {})
},
hideConfigMenu: getEnvValue("VUE_APP_HIDE_CONFIG_MENU", true),
hideArtificalSolutionsBranding: getEnvValue("VUE_APP_HIDE_AS_BRANDING", false),
loadFreshConfigForNewSessions: getEnvValue("VUE_APP_LOAD_FRESH_CONFIG_FOR_NEW_SESSIONS", false),
mustGetStaticDefaultConfig: getEnvValue("VUE_APP_GET_STATIC_DEFAULT_CONFIG", false),
liveChat: {
licenseKey: getEnvValue("VUE_APP_LIVE_CHAT_INC_KEY"),
agentAssistServerUrl: getEnvValue("VUE_APP_LIVE_CHAT_AGENT_ASSIST_SERVER")
},
pusherKey: getEnvValue("VUE_APP_PUSHER_KEY"),
locationIqKey: getEnvValue("VUE_APP_LOCATION_IQ_KEY"),
firebase: {
apiKey: getEnvValue("VUE_APP_FIREBASE_API_KEY"),
authDomain: getEnvValue("VUE_APP_FIREBASE_AUTH_DOMAIN"),
databaseUrl: getEnvValue("VUE_APP_FIREBASE_DATABASE_URL"),
projectId: getEnvValue("VUE_APP_FIREBASE_PROJECT_ID"),
storageBucket: getEnvValue("VUE_APP_FIREBASE_STORAGE_BUCKET"),
messagingSenderId: getEnvValue("VUE_APP_FIREBASE_MESSAGING_SENDER_ID")
},
logging: {
sentryDsn: getEnvValue("VUE_APP_SENTRY_DSN"),
logRocket: getEnvValue("VUE_APP_LOG_ROCKET")
},
build: {
compressJavascript: getEnvValue("VUE_APP_BUILD_COMPRESS_JAVASCRIPT_ASSETS", false),
compressCss: getEnvValue("VUE_APP_BUILD_COMPRESS_CSS_ASSETS", true)
}
};
const environmentVariables = process.env;

const getEnvValue = (name, fallback = "") => {
let result = fallback;
if (name in environmentVariables && environmentVariables[name] !== "") {
result = environmentVariables[name];
if (result === "true") {
result = true;
} else if (result === "false") {
result = false;
}
}
return result;
};

export default {
isProduction: getEnvValue("NODE_ENV", "production") === "production",
killSessionOnCloseEmbed: getEnvValue("VUE_APP_EMBED_KILL_SESSION_ON_CLOSE", false),
solutionConfig: {
buildConfig: getEnvValue("VUE_APP_SOLUTION_CONFIG", {})
},
hideConfigMenu: getEnvValue("VUE_APP_HIDE_CONFIG_MENU", true),
hideArtificalSolutionsBranding: getEnvValue("VUE_APP_HIDE_AS_BRANDING", false),
loadFreshConfigForNewSessions: getEnvValue("VUE_APP_LOAD_FRESH_CONFIG_FOR_NEW_SESSIONS", false),
mustGetStaticDefaultConfig: getEnvValue("VUE_APP_GET_STATIC_DEFAULT_CONFIG", false),
liveChat: {
licenseKey: getEnvValue("VUE_APP_LIVE_CHAT_INC_KEY"),
agentAssistServerUrl: getEnvValue("VUE_APP_LIVE_CHAT_AGENT_ASSIST_SERVER")
},
kuttItKey: getEnvValue("VUE_APP_KUTT_IT_API_KEY"),
pusherKey: getEnvValue("VUE_APP_PUSHER_KEY"),
locationIqKey: getEnvValue("VUE_APP_LOCATION_IQ_KEY"),
firebase: {
apiKey: getEnvValue("VUE_APP_FIREBASE_API_KEY"),
authDomain: getEnvValue("VUE_APP_FIREBASE_AUTH_DOMAIN"),
databaseUrl: getEnvValue("VUE_APP_FIREBASE_DATABASE_URL"),
projectId: getEnvValue("VUE_APP_FIREBASE_PROJECT_ID"),
storageBucket: getEnvValue("VUE_APP_FIREBASE_STORAGE_BUCKET"),
messagingSenderId: getEnvValue("VUE_APP_FIREBASE_MESSAGING_SENDER_ID")
},
logging: {
sentryDsn: getEnvValue("VUE_APP_SENTRY_DSN"),
logRocket: getEnvValue("VUE_APP_LOG_ROCKET")
},
build: {
compressJavascript: getEnvValue("VUE_APP_BUILD_COMPRESS_JAVASCRIPT_ASSETS", false),
compressCss: getEnvValue("VUE_APP_BUILD_COMPRESS_CSS_ASSETS", true)
}
};
Loading

0 comments on commit 15af084

Please sign in to comment.