Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
frankyrumple committed Nov 13, 2024
2 parents f35061b + f9930e2 commit 53de82e
Show file tree
Hide file tree
Showing 5,922 changed files with 560 additions and 1,684,792 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,5 @@ exported_gpo
/media_files_tool/sync_media_files.dist
/client_tools/svc/OPEService.dist
/client_tools/svc/sshot.dist
sync_gui.dist
sync_gui.build
8 changes: 3 additions & 5 deletions admin_app/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@
# OPE Project - Release Notes
Important notifications and heads up on what has changed.

## [color=ff3333]!!!SECURITY ADVISORY - 5/1/2020 !!![/color]
Please make sure that laptops are all re-credentialed with the latest updates. Credential app now shows a version nubmer in green and needs to be v1.0.24 or higher. This is an urgent update and requires that all laptops be pulled ASAP and re-credentialed.

## [color=ff3333]!!!PASSWORD WARNING!!![/color]
Short passwords no longer work! Please make sure you use proper password complexity (8 characters, 1 capital, 1 lower case, 1 number, 1 symbol) for admin/facuty/student accounts as weak passwords will be rejected. Short passwords have been known to cause the following problems:
- User accounts NOT showing up in canvas after SMC import
- Canvas not properly starting up with admin/root password too short

## [color=33ff33]CURRENT VERSIONS[/color]
- SyncApp 1.34
- Laptop Credential 1.0.59
- SMC 1.9.59
- SyncApp 1.35
- Laptop Credential 1.0.119
- SMC 24.8.18.0

## 1/4/2021
- SMC 1.9.59
Expand Down
2 changes: 1 addition & 1 deletion admin_app/SyncOPEApp.kv
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@

GridLayout:
cols: 1
orientation: 'vertical'
orientation: 'tb-lr'
ActionBar:
pos_hint: { 'top': 1}
ActionView:
Expand Down
2 changes: 2 additions & 0 deletions admin_app/build.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# NOTE - VENV Below specifies which python to use for this app - currently 3.6
print("Use Nuitka build to compile instead.")
sys.exit(0)

import os
import sys
Expand Down
12 changes: 2 additions & 10 deletions admin_app/modules.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
paramiko
logging
docutils
pygments
pypiwin32
kivy.deps.sdl2
kivy.deps.glew
kivy.deps.gsteamer
kivy.deps.angle
kivy
kivy[base]
pyaes
json
uuid
requests
re
python-dateutil
44 changes: 44 additions & 0 deletions admin_app/nuitka_build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

@echo off
set VERSION=24.9.5.0


python -m nuitka ^
--standalone ^
--file-reference-choice=runtime ^
--mingw64 ^
--windows-icon-from-ico=logo_icon.ico ^
--windows-company-name=OPE_PROJECT ^
--windows-product-name=SyncAPp ^
--windows-file-version=%VERSION% ^
--windows-product-version=%VERSION% ^
--windows-file-description="Admin SyncApp - deploy or update OPE servers." ^
--disable-plugin=numpy --disable-plugin=tk-inter --disable-plugin=pyqt5 --disable-plugin=pyside2 ^
--include-package=kivy --include-package=requests --enable-plugin=kivy --include-package=kivy.uix.recycleview ^
--include-data-file="C:\Python311\share\angle\bin\*.dll=./" ^
--include-data-file="*.kv=./" ^
--include-data-file="*.json=./" ^
--include-data-file="*.ico=./" ^
--include-data-file="*.png=./" ^
--include-data-file="*.md=./" ^
--follow-imports ^
--output-filename=SyncApp.exe ^
sync_gui.py


rem --include-data-file="C:\Python311\share\angle\bin\*.dll=./" ^
rem --include-data-file="C:\Python311\share\glew\bin\*.dll=./" ^
rem --include-data-file="C:\Python311\share\sdl2\bin\*.dll=./" ^

rem assets = [("SyncOPEApp.kv", "."), ("OfflineServerSettings.json", "."), ("OnlineServerSettings.json", "."),
rem ("logo_icon.ico", "."), ("logo_icon.png", "."), ("GettingStarted.md", "."),
rem ("version.json", "."), ("eCasas.json", "."), ("ReleaseNotes.md", ".") ]

echo Copying resource files to dist folder
rem xcopy /y .\*.kv .\sync_gui.dist\
rem xcopy /y .\*.json .\sync_gui.dist\
rem xcopy /y .\*.ico .\sync_gui.dist\
rem xcopy /y .\*.png .\sync_gui.dist\
rem xcopy /y .\*.md .\sync_gui.dist\
rem xcopy /yS C:\Python311\Lib\site-packages\kivy\data\* .\kivy_install\data\
xcopy /yS C:\Python311\Lib\site-packages\kivy\uix\* .\sync_gui.dist\kivy\uix\
2 changes: 1 addition & 1 deletion admin_app/sync_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
from kivy.uix.scrollview import ScrollView
from kivy.uix.gridlayout import GridLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.recycleview import RecycleView
#from kivy.uix.recycleview import RecycleView
from kivy.config import ConfigParser
from kivy.uix.settings import SettingsWithSidebar
from kivy.uix.settings import SettingString
Expand Down
2 changes: 1 addition & 1 deletion admin_app/version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "1.34"
"version": "1.35"
}
1 change: 1 addition & 0 deletions admin_app/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from scrolllabel import ScrollLabel
from kivy.uix.button import Button
from kivy.uix.dropdown import DropDown
from kivy.uix.recycleview import RecycleView


class ThreadSafePopup:
Expand Down
2 changes: 1 addition & 1 deletion client_tools/lms/src/OPE_LMS/OPE_LMS.pro
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ CONFIG (debug, debug|release) {
#OPENSSL_PREFIX = "C:/"
OPEN_SSL_PATH = "C:/Qt/Tools/OpenSSL/Win_x64"
OPEN_SSL_DLL_PATH = $${OPEN_SSL_PATH}/bin
LIBS += -L"$${OPEN_SSL_PATH}/lib" #-llibcrypto -llibssl # -lcrypto -lssl
LIBS += -L"$${OPEN_SSL_PATH}" #-llibcrypto -llibssl # -lcrypto -lssl
INCLUDEPATH += "$${OPEN_SSL_PATH}/include"


Expand Down
16 changes: 15 additions & 1 deletion client_tools/lms/src/OPE_LMS/customlogger.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
#include "customlogger.h"


// Values for custom log handler
QString log_file_path = "/debug.log";
bool log_to_file = true;
bool is_in_IDE = false;
QFile log_file;
QTextStream &out = qStdout();
QTextStream &err = qStderr();
// Are we running in quiet mode?
bool quiet_mode = false;


QTextStream& qStdout()
{
static QTextStream r{stdout};
Expand Down Expand Up @@ -36,7 +48,9 @@ void customLogOutput(QtMsgType type, const QMessageLogContext &context,
msg, context.file);
if (!log_file.isOpen()) {
log_file.setFileName(log_file_path);
log_file.open(QIODevice::WriteOnly | QIODevice::Append);
if (!log_file.open(QIODevice::WriteOnly | QIODevice::Append)) {
err << "[ERROR OPENING LOG FILE] - " << log_file_path << " - " << log_file.errorString() << Qt::endl;
}
}

if (log_file.isOpen()) {
Expand Down
15 changes: 7 additions & 8 deletions client_tools/lms/src/OPE_LMS/customlogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ QTextStream& qStdout();

QTextStream& qStderr();

// Values for custom log handler
static QString log_file_path = "/debug.log";
static bool log_to_file = true;
static bool is_in_IDE = false;
static QFile log_file;
static QTextStream &out = qStdout();
static QTextStream &err = qStderr();
extern QString log_file_path;
extern bool log_to_file;
extern bool is_in_IDE;
extern QFile log_file;
extern QTextStream &out;
extern QTextStream &err;
// Are we running in quiet mode?
static bool quiet_mode = false;
extern bool quiet_mode;

void customLogOutput(QtMsgType type, const QMessageLogContext &context,
const QString &msg);
Expand Down
6 changes: 5 additions & 1 deletion client_tools/lms/src/OPE_LMS/external/ex_canvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,16 @@ QString EX_Canvas::pullStudentInfo()

// Make sure to set the current user id and name in the registry
if (_app_settings) {
qDebug() << "Storing student info inthe registry...";
qDebug() << "Storing student info in the registry...";
_app_settings->setValue("student/id", o["id"].toString(""));
_app_settings->setValue("student/name", o["name"].toString(""));
_app_settings->setValue("student/short_name", o["short_name"].toString(""));
_app_settings->setValue("student/sortable_name", o["sortable_name"].toString(""));
_app_settings->sync();

if(_app_settings->status() != QSettings::NoError) {
qDebug() << "Error saving settings" << _app_settings->status();
}
}

} else {
Expand Down
7 changes: 4 additions & 3 deletions client_tools/lms/src/OPE_LMS/qt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@

Translations = translations
;i18n
Prefix=./
Binaries=lib
Libraries=lib
Prefix=.
Binaries=.
;lib
Libraries=.
Plugins=plugins
Qml2Imports=qml

Expand Down
23 changes: 5 additions & 18 deletions client_tools/svc/OPEService.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,26 +395,13 @@ def monitor_login_events_thread(self):
#p(f"IpPort: {string_inserts[19]}")
event_info["IpPort"] = string_inserts[19]
else:
p(f"Event does not contain all expected fields. \n{string_inserts}", log_level=3)
p(f"Event does not contain all expected fields. \n{string_inserts}", log_level=5)
continue

if event.EventID == event_id and (event_info["LogonType"] != "5"):
if event.EventID == event_id and (event_info["LogonType"] in ["2", "7", "10", "11"]):
p(f"*** Interactive Login event detected.\n{event_info}", log_level=3)
mgmt_UserAccounts.ProcessLogonEvent(event_info)
# if username.lower() in [s.lower() for s in event.StringInserts if s]:
# print(f"Login attempt detected for user: {username}")
# disable_user_account(username)
# return
#print(f"Event Category: {event.EventCategory}")
# print(f"Time Generated: {event.TimeGenerated}")
# print(f"Source Name: {event.SourceName}")
# print(f"Event ID: {event.EventID}")
# print(f"Event Type: {event.EventType}")
# print(f"Event Record: {event.RecordNumber}")
# print(f"User SID: {event.Sid}")
# print(f"Event Data: {event.StringInserts}")
# print("="*50)
#


except Exception as e:
p("}}rbAn error occurred trying to check for login events: " + f"{e}" + "}}xx")
Expand Down Expand Up @@ -692,10 +679,10 @@ def SvcOtherEx(self, control, event_type, data):
# data is a single elt tuple, but this could potentially grow
# in the future if the win32 struct does
msg = "Session event: type=%s, data=%s" % (event_type, data)
if event_type == win32ts.WTS_SESSION_LOGON:
if event_type == 0x5: # WTS_SESSION_LOGON:
# Logon event
p(f"SvcOtherEx - Login event detected - {data}", log_level=3)
elif event_type == win32ts.WTS_SESSION_LOGOFF:
elif event_type == 0x6: # WTS_SESSION_LOGOFF:
# Logoff event
p(f"SvcOtherEx - Logoff event detected - {data}", log_level=3)

Expand Down
2 changes: 1 addition & 1 deletion client_tools/svc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Nuitka doesn't work for services unless you pay for commercial packages.
.\nuitka_lock_screen_widget_build.cmd - for lock screen widget - copy over lock_screen_widget.dist folder
.\nuitka_sshot_build.cmd - copy over sshot.dist folder

For OPEService - (use python 3)
For OPEService - (use python 3 - USE CUSTOM PYINSTALLER)
python .\build_svc.py - copy over dist/opeservice folder


Expand Down
15 changes: 11 additions & 4 deletions client_tools/svc/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,17 @@ def init_logger():

# POWERSHELL FIXES - Adjust colors when running in powershell to make them more readable
# Get parent process name
parent_proc_name = psutil.Process(os.getppid()).name()
if 'pwsh' in parent_proc_name or 'powershell' in parent_proc_name:
# Make red only use bold so it is readable
color_codes["}}rn"] = color_codes["}}rb"]
try:
parent_proc_name = psutil.Process(os.getppid()).name()
if 'pwsh' in parent_proc_name or 'powershell' in parent_proc_name:
# Make red only use bold so it is readable
color_codes["}}rn"] = color_codes["}}rb"]
# Change magenta to white as magenta doesn't show up
color_codes["}}mn"] = color_codes["}}wb"]
color_codes["}}mi"] = color_codes["}}wi"]
color_codes["}}md"] = color_codes["}}wd"]
except Exception as ex:
pass

markup_color_codes = {

Expand Down
4 changes: 2 additions & 2 deletions client_tools/svc/mgmt.version
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "1.0.119"
}
"version": "24.10.11.0"
}
40 changes: 27 additions & 13 deletions client_tools/svc/mgmt_CredentialProcess.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ def get_credentialed_admin():

@staticmethod
def config_mgmt_utility_once():
# Setup local groups for students and admins
UserAccounts.create_local_students_group()
UserAccounts.create_local_admins_group()

# Create registry entries and set permissions
RegistrySettings.set_default_ope_registry_permissions(force=True)

# Create programdata\ope folders and set permissions
FolderPermissions.set_default_ope_folder_permissions(force=True)

# Run the config mgmt utility once
if RegistrySettings.get_reg_value(value_name="smc_url", default="<NOT CONFIGURED>") == "<NOT CONFIGURED>":
Expand Down Expand Up @@ -612,11 +621,12 @@ def lock_machine():
p("}}rbNot Credentiled! - Unable to find credentialed student - not locking machine!}}xx")
return False

# Get the current admin user name
admin_user_name = CredentialProcess.get_credentialed_admin()
if admin_user_name is None:
p("}}rbNot Credentiled! - Unable to find credentialed admin account - not locking machine!}}xx")
return False
# Discontinue use of credentialed admin account
# # Get the current admin user name
# admin_user_name = CredentialProcess.get_credentialed_admin()
# if admin_user_name is None:
# p("}}rbNot Credentiled! - Unable to find credentialed admin account - not locking machine!}}xx")
# return False

laptop_network_type = CredentialProcess.get_credentialed_network_type()
laptop_domain_name = CredentialProcess.get_credentialed_domain_name()
Expand Down Expand Up @@ -668,10 +678,11 @@ def lock_machine():
p("}}rbError - Could not reset default groups for student!\nStudent Account NOT unlocked!}}xx")
return False

# Reset admin users group memberships
if not UserAccounts.set_default_groups_for_admin(admin_user_name):
p("}}rbError - Could not reset default groups for the admin account!\nStudent Account NOT unlocked!}}xx")
return False
# Discontinue use of credentialed admin account
# # Reset admin users group memberships
# if not UserAccounts.set_default_groups_for_admin(admin_user_name):
# p("}}rbError - Could not reset default groups for the admin account!\nStudent Account NOT unlocked!}}xx")
# return False

# Ensure the OPEService is running
if not CredentialProcess.ensure_opeservice_running():
Expand All @@ -686,10 +697,10 @@ def lock_machine():
# return False

# Enable student account
# if laptop_network_type == "Standalone":
# if not UserAccounts.enable_account(student_user_name):
# p("}}rbError - Failed to enable student account: " + str(student_user_name) + "}}xx")
# return False
if laptop_network_type == "Standalone":
if not UserAccounts.enable_account(student_user_name):
p("}}rbError - Failed to enable student account: " + str(student_user_name) + "}}xx")
return False
# else:
# # TODO - list student account in allowed users to login
# p("}}ybRunning in Domain Mode, not enabling student account.}}xx")
Expand Down Expand Up @@ -787,6 +798,9 @@ def start_upgrade_process(branch=None, force_upgrade=None):
if not force_upgrade is True and not CredentialProcess.is_time_to_upgrade():
p("}}gnNot time to check for upgrades yet, skipping...}}xx", log_level=3)
return None
p("}}rbSoftware Upgrades Disabled...}}xx")
# TODO - Reimplement software upgrade with download and unpack zip - remove GIT stuff
return None

curr_branch = branch
if curr_branch is None:
Expand Down
Loading

0 comments on commit 53de82e

Please sign in to comment.