Skip to content

Fixes #91

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 75 additions & 70 deletions tools/docker-dev/sql/bootstrap.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
-- version 4.9.5deb2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Sep 22, 2022 at 08:36 PM
-- Server version: 10.3.34-MariaDB-0ubuntu0.20.04.1
-- PHP Version: 7.4.3
-- Host: 127.0.0.1
-- Generation Time: Jul 11, 2023 at 04:05 PM
-- Server version: 10.3.37-MariaDB-0ubuntu0.20.04.1
-- PHP Version: 7.4.3-4ubuntu2.17

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
Expand All @@ -24,6 +24,33 @@ SET time_zone = "+00:00";

-- --------------------------------------------------------

--
-- Table structure for table `account_deletion_requests`
--

CREATE TABLE `account_deletion_requests` (
`id` int(11) NOT NULL,
`timestamp` timestamp NOT NULL DEFAULT current_timestamp(),
`uid` varchar(1000) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `audit_log`
--

CREATE TABLE `audit_log` (
`id` int(11) NOT NULL,
`timestamp` timestamp NOT NULL DEFAULT current_timestamp(),
`operator` varchar(1000) NOT NULL,
`operator_ip` varchar(1000) NOT NULL,
`action_type` varchar(1000) NOT NULL,
`recipient` varchar(1000) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `events`
--
Expand All @@ -34,7 +61,7 @@ CREATE TABLE `events` (
`action` varchar(300) NOT NULL,
`entity` varchar(300) NOT NULL,
`timestamp` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

Expand All @@ -47,7 +74,7 @@ CREATE TABLE `notices` (
`date` timestamp NOT NULL DEFAULT current_timestamp(),
`title` varchar(300) NOT NULL,
`message` longtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `notices`
Expand All @@ -67,16 +94,15 @@ CREATE TABLE `pages` (
`id` int(11) NOT NULL,
`page` varchar(300) NOT NULL,
`content` longtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `pages`
--

INSERT INTO `pages` (`id`, `page`, `content`) VALUES
(1, 'support', '<h3>Docmentation and FAQ</h3>\r\n<p>You can find our documentation <a href=\"https://esdconfluence.it.umass.edu/confluence/display/UNITY/Unity+Cluster+Documentation+Home\" target=\"_blank\">here</a>. We also have an <a target=\"_blank\" href=\"https://esdconfluence.it.umass.edu/confluence/display/UNITY/Frequently+Asked+Questions\">FAQ</a> page which could help answer quick questions.\r\n\r\n<h3>Office Hours</h3>\r\n<p>We offer office hours every week on <strong>Tuesdays 2-4 PM</strong> in-person at <strong>W.E.B. DuBois Library 786</strong> or remote on <strong><a target=\"_blank\" href=\"https://umass-amherst.zoom.us/j/95663998309\">Zoom</a></strong>. Be sure to check the <a href=\"<?php echo $CONFIG[\"site\"][\"prefix\"]; ?>/index.php\">cluster notes</a> page for up-to-date information on any canceled/delayed office hours.</p>\r\n\r\n<h3>Support Email</h3>\r\n<p>You can create a support ticket by emailing <a target=\"_blank\" href=\"mailto:hpc@umass.edu\">hpc@umass.edu</a>. We will do our best to reply as fast as possible!</p>'),
(2, 'policy', '<p>By using resources associated with Unity, you agree to comply with the following conditions of use. This is an extension of the University of Massachussetts Amherst Information Technology Acceptable Use Policy, which can be found <a target=\"_blank\" href=\"https://www.umass.edu/it/security/acceptable-use-policy\">here</a>.</p>\r\n\r\n<ol>\r\n <li>You will not use Unity resources for illicit financial gain, such as virtual currency mining, or any unlawful purpose, nor attempt to breach or circumvent any Unity administrative or security controls. You will comply with all applicable laws, working with your home institution and the specific Unity service providers utilized to determine what constraints may be placed on you by any relevant regulations such as export control law or HIPAA.</li>\r\n <li>You will respect intellectual property rights and observe confidentiality agreements.</li>\r\n <li>You will protect the access credentials (e.g., passwords, private keys, and/or tokens) issued to you or generated to access Unity resources; these are issued to you for your sole use.</li>\r\n <li>You will immediately report any known or suspected security breach or loss or misuse of Unity access credentials to <a href=\"mailto:hpc@it.umass.edu\">hpc@it.umass.edu</a>.</li>\r\n <li>You will have only one Unity User account and will keep your profile information up-to-date.</li>\r\n <li>Use of resources and services through Unity is at your own risk. There are no guarantees that resources and services will be available, that they will suit every purpose, or that data will never be lost or corrupted. Users are responsible for backing up critical data.</li>\r\n <li>Logged information, including information provided by you for registration purposes, is used for administrative, operational, accounting, monitoring and security purposes. This information may be disclosed, via secured mechanisms, only for the same purposes and only as far as necessary to other organizations cooperating with Unity .</li>\r\n</ol>\r\n\r\n<p>The Unity team reserves the right to restrict access to any individual/group found to be in breach of the above.</p>'),
(3, 'home', '<p>Home page content</p><p>Other line</p>');
(2, 'policy', '<p>By using resources associated with Unity, you agree to comply with the following conditions of use. This is an extension of the University of Massachussetts Amherst Information Technology Acceptable Use Policy, which can be found <a target=\"_blank\" href=\"https://www.umass.edu/it/security/acceptable-use-policy\">here</a>.</p>\r\n\r\n<ol>\r\n <li>You will not use Unity resources for illicit financial gain, such as virtual currency mining, or any unlawful purpose, nor attempt to breach or circumvent any Unity administrative or security controls. You will comply with all applicable laws, working with your home institution and the specific Unity service providers utilized to determine what constraints may be placed on you by any relevant regulations such as export control law or HIPAA.</li>\r\n <li>You will respect intellectual property rights and observe confidentiality agreements.</li>\r\n <li>You will protect the access credentials (e.g., passwords, private keys, and/or tokens) issued to you or generated to access Unity resources; these are issued to you for your sole use.</li>\r\n <li>You will immediately report any known or suspected security breach or loss or misuse of Unity access credentials to <a href=\"mailto:hpc@it.umass.edu\">hpc@it.umass.edu</a>.</li>\r\n <li>You will have only one Unity User account and will keep your profile information up-to-date.</li>\r\n <li>Use of resources and services through Unity is at your own risk. There are no guarantees that resources and services will be available, that they will suit every purpose, or that data will never be lost or corrupted. Users are responsible for backing up critical data.</li>\r\n <li>Logged information, including information provided by you for registration purposes, is used for administrative, operational, accounting, monitoring and security purposes. This information may be disclosed, via secured mechanisms, only for the same purposes and only as far as necessary to other organizations cooperating with Unity .</li>\r\n</ol>\r\n\r\n<p>The Unity team reserves the right to restrict access to any individual/group found to be in breach of the above.</p>');

-- --------------------------------------------------------

Expand All @@ -89,56 +115,50 @@ CREATE TABLE `requests` (
`request_for` varchar(1000) NOT NULL,
`uid` varchar(1000) NOT NULL,
`timestamp` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `audit_log`
-- Table structure for table `sitevars`
--

CREATE TABLE `audit_log` (
CREATE TABLE `sitevars` (
`id` int(11) NOT NULL,
`timestamp` timestamp NOT NULL DEFAULT current_timestamp(),
`operator` varchar(1000) NOT NULL,
`operator_ip` varchar(1000) NOT NULL,
`action_type` varchar(1000) NOT NULL,
`recipient` varchar(1000) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- --------------------------------------------------------
`name` varchar(1000) NOT NULL,
`value` varchar(1000) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `account_deletion_requests`
-- Table structure for table `sso_log`
--

CREATE TABLE `account_deletion_requests` (
`id` int(11) NOT NULL,
`timestamp` timestamp NOT NULL DEFAULT current_timestamp(),
`uid` varchar(1000) NOT NULL,
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- --------------------------------------------------------

-- --------------------------------------------------------
CREATE TABLE `sso_log` (
`id` int(10) NOT NULL,
`uid` varchar(300) NOT NULL,
`firstname` varchar(300) NOT NULL,
`lastname` varchar(300) NOT NULL,
`mail` varchar(300) NOT NULL,
`org` varchar(300) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Table structure for table `sitevars`
-- Indexes for dumped tables
--

CREATE TABLE `sitevars` (
`id` int(11) NOT NULL,
`name` varchar(1000) NOT NULL,
`value` varchar(1000) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- --------------------------------------------------------
--
-- Indexes for table `account_deletion_requests`
--
ALTER TABLE `account_deletion_requests`
ADD PRIMARY KEY (`id`);

--
-- Indexes for dumped tables
-- Indexes for table `audit_log`
--
ALTER TABLE `audit_log`
ADD PRIMARY KEY (`id`);

--
-- Indexes for table `events`
Expand All @@ -165,32 +185,32 @@ ALTER TABLE `requests`
ADD PRIMARY KEY (`id`);

--
-- Indexes for table `sso_log`
-- Indexes for table `sitevars`
--
ALTER TABLE `sso_log`
ALTER TABLE `sitevars`
ADD PRIMARY KEY (`id`);

--
-- Indexes for table `audit_log`
-- Indexes for table `sso_log`
--
ALTER TABLE `audit_log`
ALTER TABLE `sso_log`
ADD PRIMARY KEY (`id`);

--
-- Indexes for table `audit_log`
-- AUTO_INCREMENT for dumped tables
--
ALTER TABLE `account_deletion_requests`
ADD PRIMARY KEY (`id`);

--
-- Indexes for table `sitevars`
-- AUTO_INCREMENT for table `account_deletion_requests`
--
ALTER TABLE `sitevars`
ADD PRIMARY KEY (`id`);
ALTER TABLE `account_deletion_requests`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for dumped tables
-- AUTO_INCREMENT for table `audit_log`
--
ALTER TABLE `audit_log`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `events`
Expand All @@ -217,31 +237,16 @@ ALTER TABLE `requests`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1031;

--
-- AUTO_INCREMENT for table `sso_log`
--
ALTER TABLE `sso_log`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `audit_log`
--
ALTER TABLE `audit_log`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;

--
--
-- AUTO_INCREMENT for table `account_deletion_requests`
-- AUTO_INCREMENT for table `sitevars`
--
ALTER TABLE `account_deletion_requests`
ALTER TABLE `sitevars`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;

--
-- AUTO_INCREMENT for table `sitevars`
-- AUTO_INCREMENT for table `sso_log`
--
ALTER TABLE `sitevars`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
ALTER TABLE `sso_log`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
Expand Down
1 change: 1 addition & 0 deletions webroot/panel/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
echo "<p>You are currently not assigned to any PI, and will be
<strong>unable to use the cluster</strong>. Go to the <a href='groups.php'>My PIs</a>
page to join a PI, or click on the button below if you are a PI</p>";
echo "<p>Students should not request a PI account.</p>";
}

if (!$isPI) {
Expand Down
20 changes: 12 additions & 8 deletions webroot/panel/modal/new_key.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,11 @@
}
});

$("div#key_generate > button").click(function() {
function generateKey(type) {
var pubSection = "<section class='pubKey'>";
var privSection = "<section class='privKey'>";
var endingSection = "</section>";

// get type
if ($(this).hasClass('btnWin')) {
var type = "ppk";
} else if ($(this).hasClass('btnLin')) {
var type = "key";
}

$.ajax({
url: "<?php echo $CONFIG["site"]["prefix"]; ?>/js/ajax/ssh_generate.php?type=" + type,
success: function(result) {
Expand All @@ -89,6 +82,17 @@
$("#newKeyform").submit();
}
});
}

$("div#key_generate > button").click(function() {
// get type
if ($(this).hasClass('btnWin')) {
var type = "ppk";
} else if ($(this).hasClass('btnLin')) {
var type = "key";
}

setTimeout(() => generateKey(type), 300);
});

$("textarea[name=key]").on("input", function() {
Expand Down