Commit 16319b60 authored by Cooper, Caleb's avatar Cooper, Caleb

Merge branch 'dev' into 'master'

Version 1.0.11

See merge request !74
parents f17fe3af 625cf73a
Pipeline #26149 passed with stages
in 1 minute and 6 seconds
*.rpm
*.deb
ornltoolbox/
Releases*
......@@ -8,6 +8,7 @@
<script src="../miscjs/addWindow.js"></script>
<script src="../miscjs/backToMain.js"></script>
<script src="../miscjs/openURL.js"></script>
<script src="../miscjs/launchBomgar.js"></script>
<script src="../softwareManagement/openSoftware/openSoftware.js"></script>
<script src="../miscjs/menuFunctionCalls.js"></script>
<script src="./yubiBadgeCheckpoint/yubiBadgeCheckpoint.js"></script>
......
#! /bin/bash
RECIPIENT="$1"
SUBJECT='Badge Reminder'
BODY='You left your badge in your computer'
EMAIL="HELO ${HOSTNAME}
MAIL FROM: no-reply@ornl.gov
RCPT TO: ${RECIPIENT}
DATA
From: <no-reply@ornl.gov>
To: <${RECIPIENT}>
Date: $(date "+%a, %d %b %Y %H:%M:%S %z")
Subject: ${SUBJECT}
${BODY}
.
QUIT
"
echo "${EMAIL}" > /dev/tcp/smtp.ornl.gov/25
......@@ -20,14 +20,8 @@ remindUser () {
(( counter += 1 ))
if [[ "$counter" -ge "$maxCounter" ]] || [[ "$counter" -ge 6 ]] && [[ "$2" != "none" ]] && [[ "$textSent" == 0 ]]
then
if [[ $(grep Ubuntu /etc/os-release) ]]
then
#For Ubuntu
echo "You left your badge in your computer" | s-nail -S smtp=smtp.ornl.gov:25 -r "no-reply@ornl.gov" -s "Badge Reminder" "$2""$3"
else
#For RHEL7
echo "You left your badge in your computer" | mailx -S smtp=smtp.ornl.gov:25 -r "no-reply@ornl.gov" -s "Badge Reminder" "$2""$3"
fi
bash /opt/ornltoolbox/resources/app/badgeManagement/badgeMinder/badgeMinder-emailer.sh "${2}${3}"
#Text has been sent, don't send another
textSent=1
fi
......@@ -43,12 +37,7 @@ remindUser () {
#Send text reminder immediately, beeping is disabled
if [[ "$2" != "none" ]] && [[ "$1" == 0 ]]
then
if [[ $(grep Ubuntu /etc/os-release) ]]
then
echo "You left your badge in your computer" | s-nail -S smtp=smtp.ornl.gov:25 -r "no-reply@ornl.gov" "$2""$3"
else
echo "You left your badge in your computer" | mailx -S smtp=smtp.ornl.gov:25 -r "no-reply@ornl.gov" "$2""$3"
fi
bash /opt/ornltoolbox/resources/app/badgeManagement/badgeMinder/badgeMinder-emailer.sh "${2}${3}"
fi
}
......
......@@ -4,12 +4,7 @@ source ~/.config/ornltoolbox/badgeMinder.config
#If enabled, test text reminder
if [[ "$phone" != "none" ]]
then
if [[ $(grep Ubuntu /etc/os-release) ]]
then
echo "You left your badge in your computer" | s-nail -S smtp=smtp.ornl.gov:25 -r "no-reply@ornl.gov" "$phone""$carrier"
else
echo "You left your badge in your computer" | mailx -S smtp=smtp.ornl.gov:25 -r "no-reply@ornl.gov" "$phone""$carrier"
fi
bash /opt/ornltoolbox/resources/app/badgeManagement/badgeMinder/badgeMinder-emailer.sh "${phone}${carrier}"
fi
#If enabled, test beep reminder
......
......@@ -6,7 +6,7 @@ if [[ ${CI_COMMIT_REF_NAME} == 'master' ]]; then
else
BRANCH="-${CI_COMMIT_REF_NAME}"
fi
VERSION_NUMBER='1.0.7'
VERSION_NUMBER='1.0.11'
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -ivh epel-release-latest-7.noarch.rpm
sudo yum -y install nodejs npm ruby-devel gcc make rpm-build rubygems
......@@ -14,7 +14,7 @@ gem install --no-ri --no-rdoc fpm
npm install electron
npm install electron-packager
sed -i "s/VERSION_NUMBER/$VERSION_NUMBER/" ./about/about.html
npm run build
npm run build
mv ./Releases/ornltoolbox-linux-x64 ./ornltoolbox
sudo /usr/local/bin/fpm -s dir -f -n ornltoolbox${BRANCH} --provides ornltoolbox --deb-no-default-config-files -v $VERSION_NUMBER --description "A collection of ORNL Linux tools" -t deb -p /opt/ornltoolbox${BRANCH}-${VERSION_NUMBER}.deb --prefix /opt --after-install ./packages/packagePostInstall.bash --after-remove ./packages/packagePostRemove.bash --before-upgrade ./packages/packagePostRemove.bash --after-upgrade ./packages/packagePostInstall.bash -d 'libgconf-2-4' -d 'gnome-screensaver' -d 'yubico-piv-tool' -d 'sox' -d 'smartmontools' -d 'policykit-1-gnome' -d 'desktop-file-utils' ./ornltoolbox
sudo /usr/local/bin/fpm -s dir -f -n ornltoolbox${BRANCH} --provides ornltoolbox --deb-no-default-config-files -v $VERSION_NUMBER --description "A collection of ORNL Linux tools" -t rpm -p /opt/ornltoolbox${BRANCH}-${VERSION_NUMBER}.rpm --prefix /opt --after-install ./packages/packagePostInstall.bash --after-remove ./packages/packagePostRemove.bash --before-upgrade ./packages/packagePostRemove.bash --after-upgrade ./packages/packagePostInstall.bash -d 'libXScrnSaver' -d 'gnome-screensaver' -d 'yubico-piv-tool' -d 'sox' -d 'smartmontools' -d 'polkit-gnome' ./ornltoolbox
......
......@@ -8,6 +8,7 @@
<script src="../miscjs/addWindow.js"></script>
<script src="../miscjs/backToMain.js"></script>
<script src="../miscjs/openURL.js"></script>
<script src="../miscjs/launchBomgar.js"></script>
<script src="../softwareManagement/openSoftware/openSoftware.js"></script>
<script src="../miscjs/menuFunctionCalls.js"></script>
<script src="../badgeManagement/yubiBadgeCheckpoint/yubiBadgeCheckpoint.js"></script>
......
......@@ -14,6 +14,7 @@
<script src="./softwareManagement/softwareManagement.js"></script>
<script src="./softwareManagement/openSoftware/openSoftware.js"></script>
<script src="./miscjs/openURL.js"></script>
<script src="./miscjs/launchBomgar.js"></script>
<script src="./badgeManagement/yubiBadgeCheckpoint/yubiBadgeCheckpoint.js"></script>
<script src="./fileSystemManagement/localDriveUsage/localDriveUsage.js"></script>
<script src="./miscjs/menuFunctionCalls.js"></script>
......@@ -47,7 +48,7 @@
</span>
<!-- <span title="Opens https://ornl.service-now.com/dm in a browser window.">
<div id="buttons" onclick="openURL('https://ornl.service-now.com/dm')"><font color="white">Device Manager</font></div> -->
<span title="This feature is coming soon.">
<span title="This feature has not yet been implemented but is coming soon.">
<div id="buttonsMissing"><font color="white">Coming Soon</font></div>
</span>
<span title="Switches to the application page for IT Services & Support webpages.">
......
......@@ -8,6 +8,7 @@
<script src="../miscjs/addWindow.js"></script>
<script src="../miscjs/backToMain.js"></script>
<script src="../miscjs/openURL.js"></script>
<script src="../miscjs/launchBomgar.js"></script>
<script src="../softwareManagement/openSoftware/openSoftware.js"></script>
<script src="../miscjs/menuFunctionCalls.js"></script>
<script src="../badgeManagement/yubiBadgeCheckpoint/yubiBadgeCheckpoint.js"></script>
......@@ -15,7 +16,6 @@
<script src="../fileSystemManagement/addPassphrase/addPassphrase.js"></script>
<script src="../fileSystemManagement/removePassphrase/removePassphrase.js"></script>
<script src="../fileSystemManagement/driveHealthCheck/driveHealthCheck.js"></script>
<script src="../miscjs/launchBomgar.js"></script>
</head>
<body>
<div class="heading">
......@@ -50,7 +50,7 @@
<span title="Opens the ORNL Network Registration (NetReg), used for checking system compliance, in a browser window.">
<div id="buttons" onclick="openURL('https://netreg.ornl.gov')"><font color="white">NetReg</font></div>
</span>
<span title="Launching a Bomgar Session">
<span title="Opens the ORNL Computer Helpline Support Portal, used for remote assistance, in a browser window.">
<div id="buttons" onclick="launchBomgar()"><font color="white">Remote Support</font></div>
</span>
</div>
......
......@@ -4,6 +4,8 @@ const ipcMain = require('electron').ipcMain
const execSync = require('child_process').execSync
const path = require('path')
const url = require('url')
const mainWinWidth = 800
const mainWinHeight = 600
//Allows changes while app is running
/*require('electron-reload')(__dirname, {
......@@ -15,12 +17,21 @@ global.addWindow = null //Secondary minor window
global.promptWindow = null //Add User prompt window
function createWindow() {
//Center this main window on the display the cursor is on
let screen = require('electron').screen
let bounds = screen.getDisplayNearestPoint(screen.getCursorScreenPoint()).bounds
let x = Math.ceil(bounds.x + (bounds.width - mainWinWidth) / 2)
let y = Math.ceil(bounds.y + (bounds.height - mainWinHeight) / 2)
//Load the inital window
mainWindow = new BrowserWindow({
show: false,
width:800,
height:600,
resizable:false,
width: mainWinWidth,
height: mainWinHeight,
x: x,
y: y,
resizable: false,
center: true,
backgroundColor: '#FFFFFF',
icon: __dirname + '/images/if_gear_1055051.png'
})
......@@ -97,7 +108,7 @@ function createWindow() {
}, {
label: 'Sudo Management',
click: () => {
//Go to button page
mainWindow.webContents.send('openSudoManagement')
}
}
]
......@@ -216,6 +227,13 @@ function createWindow() {
click: () => {
mainWindow.webContents.send('openWebsite', 'https://netreg.ornl.gov')
}
}, {
type: 'separator'
}, {
label: 'Remote Support',
click: () => {
mainWindow.webContents.send('launchBomgar')
}
}
]
}, {
......@@ -249,17 +267,28 @@ function addWin(file, title, width, height) {
} else {
// Create a new window if one does not exist
if(addWindow == null) {
//Center new window on the display the cursor is on
let screen = require('electron').screen
let bounds = screen.getDisplayNearestPoint(screen.getCursorScreenPoint()).bounds
let x = Math.ceil(bounds.x + (bounds.width - width) / 2)
let y = Math.ceil(bounds.y + (bounds.height - height) / 2)
addWindow = new BrowserWindow({
title: title,
show: false,
parent: mainWindow,
width: width,
height: height,
x: x,
y: y,
resizable: false,
alwaysOnTop: true
})
} else {
//Allow resizing when the window content is changing
addWindow.setResizable(true)
addWindow.setSize(width, height)
addWindow.setResizable(false)
}
addWindow.loadFile(file)
......@@ -286,6 +315,7 @@ function addWin(file, title, width, height) {
//Based off of electron-prompt from https://github.com/konsumer/electron-prompt
//It has been modified to fit my needs
//This is a tertiary window unique to Add User - appears for users not in UCAMS
var promptResponse
ipcMain.on('prompt', function(eventRet, arg) {
promptResponse = null
......@@ -339,6 +369,7 @@ ipcMain.on('close minor window', () => {
ipcMain.on('close app', () => {
app.quit()
exit()
})
app.on('ready', createWindow)
......
function load() {
checkForRoot()
loadSoftwareBadges()
loadDeviceBadges()
//Disabled for now because waiting on Device Monitor
//loadDeviceBadges()
}
......@@ -12,6 +12,10 @@ ipcRenderer.on('openSyncPasswords', () => {
addWinMain('./userManagement/syncPasswords/syncPasswords.html', 'Sync Passwords', 350, 210)
})
ipcRenderer.on('openSudoManagement', () => {
addWinMain('./userManagement/sudoManagement/sudoManagement.html', 'Sudo Management', 260, 200)
})
ipcRenderer.on('openBadgeMinder', () => {
addWinMain('./badgeManagement/badgeMinder/badgeMinder.html', 'Badge Minder', 450, 360)
})
......@@ -28,6 +32,10 @@ ipcRenderer.on('openWebsite', (event, message) => {
openURL(message)
})
ipcRenderer.on('launchBomgar', () => {
launchBomgar()
})
ipcRenderer.on('openInstaller', () => {
openSoftware(0)
})
......
......@@ -3,7 +3,7 @@
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
<!--Allows pkexec to work on baobab-->
<action id="org.freedesktop.policykit.pkexec.run-baobab">
<description>Run Baobab</description>
<message>Authentication is required to run Baobab</message>
......
......@@ -8,6 +8,7 @@
<script src="../miscjs/addWindow.js"></script>
<script src="../miscjs/backToMain.js"></script>
<script src="../miscjs/openURL.js"></script>
<script src="../miscjs/launchBomgar.js"></script>
<script src="./openSoftware/openSoftware.js"></script>
<script src="../miscjs/menuFunctionCalls.js"></script>
<script src="../miscjs/loadSoftwareBadges.js"></script>
......
......@@ -8,6 +8,7 @@
<script src="../miscjs/addWindow.js"></script>
<script src="../miscjs/backToMain.js"></script>
<script src="../miscjs/openURL.js"></script>
<script src="../miscjs/launchBomgar.js"></script>
<script src="../softwareManagement/openSoftware/openSoftware.js"></script>
<script src="../miscjs/menuFunctionCalls.js"></script>
<script src="../badgeManagement/yubiBadgeCheckpoint/yubiBadgeCheckpoint.js"></script>
......@@ -43,7 +44,7 @@
<span title="Opens a new window with the function of syncing UCAMS passwords with local passwords.">
<div id="buttons" onclick="addWinMain('./userManagement/syncPasswords/syncPasswords.html', 'Sync Passwords', 350, 210)"><font color="white">Sync Passwords</font></div>
</span>
<span title="Opens a new window with the function of adding or removing sudo privileges of users.">
<span title="Opens a new window with the function of giving or revoking sudo privileges of users.">
<div id="buttons" onclick="addWinMain('./userManagement/sudoManagement/sudoManagement.html', 'Sudo Management', 260, 200)"><font color="white">Sudo Management</font></div>
</span>
<div id="userManagementHiddenbuttons"></div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment