Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
63547b8
Step 1 ~ Creating Boolean
RitaLei123 Nov 29, 2023
00c5f56
Fix Syntax
RitaLei123 Nov 29, 2023
188da08
Changes
RitaLei123 Dec 1, 2023
fa329e0
Fix class
RitaLei123 Dec 4, 2023
c002eb5
Merge branch 'main' into 9982-self-account-creation
micpap25 May 31, 2024
9fe327f
missing break
micpap25 Jun 3, 2024
230effe
Merge branch 'main' into 9982-self-account-creation
micpap25 Jun 3, 2024
4482711
Clean up links, and make progress on page
micpap25 Jun 17, 2024
96bab54
Fix merge conflicts
IDzyre Jul 11, 2024
34f015d
Adds user to database, can't login yet
IDzyre Jul 15, 2024
bbd1e60
Fix setup scripts
IDzyre Jul 15, 2024
6ae1131
Fix testing setup file
IDzyre Jul 15, 2024
51f7b41
Add password, and email checks
IDzyre Jul 16, 2024
71badd7
Maybe fix php unit tests?
IDzyre Jul 16, 2024
2c73759
Fix php lint
IDzyre Jul 16, 2024
f6f111b
Fix more php linting
IDzyre Jul 16, 2024
848715c
phpstan errors
IDzyre Jul 16, 2024
ad8522a
More phpstan stuff
IDzyre Jul 16, 2024
d0508a9
Merge branch 'main' into 9982-self-account-creation
IDzyre Jul 17, 2024
d3d775c
Add migration
IDzyre Jul 18, 2024
ca3cd5a
Fix migration
IDzyre Jul 18, 2024
9b47386
Merge branch 'main' into 9982-self-account-creation
IDzyre Jul 18, 2024
ee8d942
Fix variable
IDzyre Jul 18, 2024
02a7971
Merge branch 'main' into 9982-self-account-creation
IDzyre Jul 19, 2024
dbc5895
Merge branch 'main' into 9982-self-account-creation
IDzyre Jul 22, 2024
13f147c
Should fix php unit tests
IDzyre Jul 22, 2024
d2d613b
Fix missing quotes
IDzyre Jul 28, 2024
4837d94
Add user_id requirements
IDzyre Jul 29, 2024
043d14e
Default to all user_ids
IDzyre Jul 29, 2024
b6285d7
linting
IDzyre Jul 29, 2024
b92be11
phpstan
IDzyre Jul 29, 2024
4499c47
Merge branch 'main' into 9982-self-account-creation
IDzyre Jul 30, 2024
a303aa2
Add tooltip for password
IDzyre Jul 30, 2024
ecf44af
Merge branch 'main' into 9982-self-account-creation
IDzyre Jul 31, 2024
34dd7a7
Move files, and add tooltips for userid and email
IDzyre Jul 31, 2024
d5befce
Merge branch '9982-self-account-creation' of github.com:Submitty/Subm…
IDzyre Jul 31, 2024
1ff1cb1
Switch from tooltip to dropdown
IDzyre Aug 1, 2024
019c839
Switch to config values, update migration
IDzyre Aug 5, 2024
daa16ad
Beginning work for email verification
IDzyre Aug 5, 2024
ab4ea60
More work for email verification
IDzyre Aug 6, 2024
b3b0bcc
Dump master db
IDzyre Aug 6, 2024
b4da3e4
Merge branch 'main' into 9982-self-account-creation
IDzyre Aug 7, 2024
8c3685b
Email link sort of works, add get user queries
IDzyre Aug 8, 2024
f67b869
Merge branch '9982-self-account-creation' of github.com:Submitty/Subm…
IDzyre Aug 8, 2024
9c66dd3
Remove users edit, change to only unverified_users and dump database
IDzyre Aug 8, 2024
3f3aa0e
Email verification works, resend email works, need to refine and make…
IDzyre Aug 8, 2024
553de67
Merge remote-tracking branch 'origin/main' into 9982-self-account-cre…
IDzyre Aug 9, 2024
d0df597
Fix merge conflict
IDzyre Aug 9, 2024
94527d8
Fix db dumb, css lint, add magic methods for exp and code, add email …
IDzyre Aug 9, 2024
95ea982
Add config elements to tester
IDzyre Aug 9, 2024
8f42c6c
Phplint fixes
IDzyre Aug 9, 2024
1a40f21
Hopefully fix config tester
IDzyre Aug 9, 2024
62c57b5
Lint and unit tests
IDzyre Aug 11, 2024
93ffa02
Does this make it break?
IDzyre Aug 13, 2024
18b1d80
Switch to system migration
IDzyre Aug 14, 2024
0d753a8
Change to void return types
IDzyre Aug 14, 2024
765361c
Remove unneeded variables from unverified_users database
IDzyre Aug 15, 2024
00dc709
Merge branch 'main' into 9982-self-account-creation
IDzyre Aug 15, 2024
bd3701a
Merge branch 'main' into 9982-self-account-creation
IDzyre Aug 19, 2024
c92257a
Comment out git tests to be able to run cypress tests
IDzyre Aug 19, 2024
dbaae7c
Should fix git tests
IDzyre Aug 19, 2024
4c2ff32
Merge branch 'main' into 9982-self-account-creation
IDzyre Aug 19, 2024
fbdc503
working on cypress test
IDzyre Aug 20, 2024
0218125
Chris's requested changes
IDzyre Aug 28, 2024
f80f6f4
Add CI flag to JSON file, add Cypress test
IDzyre Aug 28, 2024
1b1be9d
Merge branch 'main' into 9982-self-account-creation
IDzyre Aug 28, 2024
8857ab8
try fix CI
IDzyre Aug 28, 2024
e48c78d
Merge branch '9982-self-account-creation' of github.com:Submitty/Subm…
IDzyre Aug 28, 2024
c2e8f91
Yaml lint, phplint, phpunit
IDzyre Aug 28, 2024
ca620aa
Upload Submitty JSON to see if variables are being set.
IDzyre Aug 29, 2024
ddcb512
Add is_ci to configure
IDzyre Aug 29, 2024
34af609
Fix config tester hopefully
IDzyre Aug 30, 2024
4cbfcb4
hopefully fix phpunit and cypress test
IDzyre Sep 6, 2024
d605b7b
Merge branch 'main' into 9982-self-account-creation
IDzyre Sep 6, 2024
1e96fa0
Try \s for sed
IDzyre Sep 9, 2024
5dec483
Merge branch '9982-self-account-creation' of github.com:Submitty/Subm…
IDzyre Sep 9, 2024
d175e54
Fix sed
IDzyre Sep 10, 2024
34629d7
Change location of sed to under login tests
IDzyre Sep 10, 2024
d8f8501
Update ci.yml
IDzyre Sep 13, 2024
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
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ jobs:
echo "http://localhost" # submitty url
echo "" # vcs url
echo "" # institution name
echo "y" # user create account
echo "" # sysadmin email
echo "" # where to report
echo "1" # PamAuth
Expand Down Expand Up @@ -698,6 +699,17 @@ jobs:
spec: cypress/e2e/Cypress-System/login.spec.js
working-directory: ${{env.SUBMITTY_REPOSITORY}}/site
browser: chrome
- name: Switch to CI mode
run: |
sudo sed -ie '/is_ci/c\ \"is_ci\" : true,' /usr/local/submitty/config/submitty.json

- name: Run self-account-creation tests.
uses: cypress-io/github-action@v6
with:
config: baseUrl=http://localhost
spec: cypress/e2e/Cypress-System/self_account_creation.spec.js
working-directory: ${{env.SUBMITTY_REPOSITORY}}/site
browser: chrome

- name: Switch to LDAP auth
run: sudo sed -ie "s/Database/Ldap/g" ${SUBMITTY_INSTALL_DIR}/config/authentication.json
Expand Down Expand Up @@ -746,12 +758,18 @@ jobs:
http_ver=$(curl -ksI https://localhost -o/dev/null -w "%{http_version}\n")
[ "$http_ver" = "2" ] && echo "Pass" || echo "::warning::Failed"

- uses: actions/upload-artifact@v4
if: failure()
with:
name: Submitty-JSON
path: ${{env.SUBMITTY_INSTALL_DIR}}/config/submitty.json

- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: ${{env.SUBMITTY_REPOSITORY}}/site/cypress/screenshots

- uses: actions/upload-artifact@v4
if: failure()
with:
Expand Down
38 changes: 37 additions & 1 deletion .setup/CONFIGURE_SUBMITTY.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def __call__(self, parser, namespace, values, option_string=None):
'authentication_method': 0,
'institution_name' : '',
'institution_homepage' : '',
'user_create_account' : False,
'timezone' : str(tzlocal.get_localzone()),
'submitty_admin_username': '',
'email_user': '',
Expand Down Expand Up @@ -309,7 +310,16 @@ def __call__(self, parser, namespace, values, option_string=None):
INSTITUTION_HOMEPAGE = ''
print()


while True:
user_create_account = get_input("Enable Create New Account feature? [y/n]", 'y')
if (user_create_account.lower() in ['yes', 'y']):
USER_CREATE_ACCOUNT = True
break
elif (user_create_account.lower() in ['no', 'n']):
USER_CREATE_ACCOUNT = False
break
print()

SYS_ADMIN_EMAIL = get_input("What is the email for system administration?", defaults['sys_admin_email'])
SYS_ADMIN_URL = get_input("Where to report problems with Submitty (url for help link)?", defaults['sys_admin_url'])

Expand Down Expand Up @@ -445,6 +455,7 @@ def __call__(self, parser, namespace, values, option_string=None):

config['institution_name'] = INSTITUTION_NAME
config['institution_homepage'] = INSTITUTION_HOMEPAGE
config['user_create_account'] = USER_CREATE_ACCOUNT
config['debugging_enabled'] = DEBUGGING_ENABLED

# site_log_path is a holdover name. This could more accurately be called the "log_path"
Expand Down Expand Up @@ -616,7 +627,28 @@ def write(x=''):

##############################################################################
# Write submitty json
user_id_requirements = {
"all": True,
"require_name": False,
"min_length": 6,
"max_length": 25,
"name_requirements": {
"given_first": False,
"given_name": 2,
"family_name": 4
},
"require_email": False,
"email_requirements": {
"whole_email": False,
"whole_prefix": False,
"prefix_count": 6
}
}

accepted_emails = {
"gmail.com": True,
"rpi.edu": True
}
config = submitty_config
config['submitty_install_dir'] = SUBMITTY_INSTALL_DIR
config['submitty_repository'] = SUBMITTY_REPOSITORY
Expand All @@ -638,6 +670,10 @@ def write(x=''):
config['timezone'] = TIMEZONE
config['default_locale'] = DEFAULT_LOCALE
config['duck_special_effects'] = False
config['user_create_account'] = USER_CREATE_ACCOUNT
config['accepted_emails'] = accepted_emails
config['user_id_requirements'] = user_id_requirements
config['is_ci'] = False

config['worker'] = True if args.worker == 1 else False

Expand Down
1 change: 1 addition & 0 deletions .setup/ansible/roles/submitty_install/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ submitty_install_language: en_US
submitty_install_submitty_url: localhost
submitty_install_vcs_url: git.localhost
submitty_install_institution_name: Example University
submitty_install_self_account_creation: n
submitty_install_sysadmin_email: sysadmin@localhost
submitty_install_submitty_email: submitty@localhost
submitty_install_institution_url: localhost
Expand Down
1 change: 1 addition & 0 deletions .setup/ansible/roles/submitty_install/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
{{ 'https' if submitty_install_ssl_enabled else 'http' }}://{{ submitty_install_submitty_url }}
{{ submitty_install_vcs_url }}
{{ submitty_install_institution_name }}
{{ submitty_install_self_account_creation }}
{{ submitty_install_sysadmin_email }}
{{ submitty_install_submitty_email }}
{{ submitty_install_institution_url }}
Expand Down
1 change: 1 addition & 0 deletions .setup/install_system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,7 @@ en_US
${SUBMISSION_URL}


y
sysadmin@example.com
https://example.com
1
Expand Down
1 change: 1 addition & 0 deletions .setup/testing/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ en_US
http://localhost


y
sysadmin@example.com
https://example.com
1
Expand Down
1 change: 1 addition & 0 deletions autograder/tests/data/submitty_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"cgi_url": "https://submitty.test.com/cgi-bin",
"websocket_port": 8443,
"institution_name": "Test University",
"user_create_account": false,
"institution_homepage": "https://test.com",
"timezone": "America/Los_Angeles",
"duck_special_effects": false,
Expand Down
15 changes: 15 additions & 0 deletions migration/migrator/data/submitty_db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,21 @@ CREATE TABLE public.terms (
);


--
-- Name: unverified_users; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.unverified_users (
user_id character varying NOT NULL,
user_givenname character varying NOT NULL,
user_password character varying,
user_familyname character varying NOT NULL,
user_email character varying NOT NULL,
verification_code character varying(50) DEFAULT 'none'::character varying NOT NULL,
verification_expiration timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


--
-- Name: users; Type: TABLE; Schema: public; Owner: -
--
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""Migration for the Submitty master database."""


def up(config, database):
"""
Run up migration.

:param config: Object holding configuration details about Submitty
:type config: migrator.config.Config
:param database: Object for interacting with given database for environment
:type database: migrator.db.Database
"""

database.execute('''
CREATE TABLE if not exists public.unverified_users (
user_id character varying NOT NULL,
user_givenname character varying NOT NULL,
user_password character varying,
user_familyname character varying NOT NULL,
user_email character varying NOT NULL,
verification_code character varying(50) NOT NULL DEFAULT 'none',
verification_expiration timestamp DEFAULT current_timestamp
)
''')

def down(config, database):
"""
Run down migration (rollback).

:param config: Object holding configuration details about Submitty
:type config: migrator.config.Config
:param database: Object for interacting with given database for environment
:type database: migrator.db.Database
"""
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
"""Migration for the Submitty system."""
import json
user_id_requirements = {
"all": True,
"require_name": False,
"min_length": 6,
"max_length": 25,
"name_requirements": {
"given_first": False,
"given_name": 2,
"family_name": 4
},
"require_email": False,
"email_requirements": {
"whole_email": False,
"whole_prefix": False,
"prefix_count": 6
}
}

accepted_emails = {
"gmail.com": True,
"rpi.edu": True
}

def up(config):
"""
Run up migration.

:param config: Object holding configuration details about Submitty
:type config: migrator.config.Config
"""
edited_config = config.submitty
if ('user_create_account' not in edited_config):
edited_config['user_create_account'] = False
if ('user_id_requirements' not in edited_config):
edited_config['user_id_requirements'] = user_id_requirements
if ('accepted_emails' not in edited_config):
edited_config['accepted_emails'] = accepted_emails

with open(config.config_path / 'submitty.json', 'w') as file_path:
json.dump(edited_config, file_path, indent=4)

def down(config):
"""
Run down migration (rollback).

:param config: Object holding configuration details about Submitty
:type config: migrator.config.Config
"""
pass
27 changes: 27 additions & 0 deletions migration/migrator/migrations/system/20240828152944_ci_mode.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""Migration for the Submitty system."""
import json

def up(config):
"""
Run up migration.

:param config: Object holding configuration details about Submitty
:type config: migrator.config.Config
"""
edited_config = config.submitty
if ('is_ci' not in edited_config):
edited_config['is_ci'] = False

with open(config.config_path / 'submitty.json', 'w') as file_path:
json.dump(edited_config, file_path, indent=4)



def down(config):
"""
Run down migration (rollback).

:param config: Object holding configuration details about Submitty
:type config: migrator.config.Config
"""
pass
Loading