Skip to content

Commit 640c611

Browse files
committedDec 1, 2023
Merge branch 'ffsync-update' of https://github.com/mreid-tt/spksrc into ffsync-update
2 parents 4e8141c + a4af41d commit 640c611

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed
 

‎spk/ffsync/src/service-setup.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ service_postinst ()
4646
if [ "${SYNOPKG_PKG_STATUS}" = "INSTALL" ]; then
4747
# login as root sql user using whatever creds you set up for that
4848
# this sets up a user for sync storage and sets up the databases
49-
${MYSQL} -u root -p ${wizard_mysql_password_root} <<EOF
49+
${MYSQL} -u root -p"${wizard_mysql_password_root}" <<EOF
5050
CREATE USER "${DBUSER}"@"localhost" IDENTIFIED BY "${wizard_password_ffsync}";
5151
CREATE DATABASE syncstorage_rs;
5252
CREATE DATABASE tokenserver_rs;
@@ -63,7 +63,8 @@ EOF
6363
migration --migration-dir tokenserver-db/migrations run
6464

6565
# Add sync endpoint to database
66-
${MYSQL} -u ${DBUSER} -p "$(wizard_password_ffsync)" <<EOF
66+
${MYSQL} -u ${SPK_NAME} -p"${wizard_password_ffsync}" <<EOF
67+
${MYSQL} -u ${DBUSER} -p"$(wizard_password_ffsync)" <<EOF
6768
USE tokenserver_rs
6869
INSERT INTO services (id, service, pattern) VALUES
6970
(1, "sync-1.5", "{node}/1.5/{uid}");

‎spk/ffsync/src/wizard/install_uifile.sh

+17-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ page_append ()
1616
fi
1717
}
1818

19-
getPasswordValidator()
19+
getRootPasswordValidator()
2020
{
2121
validator=$(/bin/cat<<EOF
2222
{
@@ -28,6 +28,18 @@ EOF
2828
echo "$validator" | quote_json
2929
}
3030

31+
getUserPasswordValidator()
32+
{
33+
validator=$(/bin/cat<<EOF
34+
{
35+
var password = arguments[0];
36+
return -1 !== password.search("(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[^A-Za-z0-9])(?=.{10,})") && ! password.includes("ffsync");
37+
}
38+
EOF
39+
)
40+
echo "$validator" | quote_json
41+
}
42+
3143
PAGE_FFSYNC_SETUP=$(/bin/cat<<EOF
3244
{
3345
"step_title": "Firefox Sync Server 1.5 database configuration",
@@ -38,9 +50,9 @@ PAGE_FFSYNC_SETUP=$(/bin/cat<<EOF
3850
"subitems": [{
3951
"key": "wizard_mysql_password_root",
4052
"desc": "Root password",
41-
"invalidText": "Invalid password. Please ensure it has at least one uppercase letter, one lowercase letter, one digit, one special character, a minimum length of 10 characters, and does not contain the word 'root'.",
53+
"invalidText": "Password does not meet the current strength rules. The minimum password length is 10 characters and must include mixed case, numeric characters, and special characters; it must also exclude common passwords or using username as password.",
4254
"validator": {
43-
"fn": "$(getPasswordValidator)"
55+
"fn": "$(getRootPasswordValidator)"
4456
}
4557
}]
4658
}, {
@@ -49,9 +61,9 @@ PAGE_FFSYNC_SETUP=$(/bin/cat<<EOF
4961
"subitems": [{
5062
"key": "wizard_password_ffsync",
5163
"desc": "ffsync password",
52-
"invalidText": "Invalid password. Please ensure it has at least one uppercase letter, one lowercase letter, one digit, one special character, a minimum length of 10 characters, and does not contain the word 'root'.",
64+
"invalidText": "Password does not meet the current strength rules. The minimum password length is 10 characters and must include mixed case, numeric characters, and special characters; it must also exclude common passwords or using username as password.",
5365
"validator": {
54-
"fn": "$(getPasswordValidator)"
66+
"fn": "$(getUserPasswordValidator)"
5567
}
5668
}]
5769
}]

‎spk/ffsync/src/wizard/uninstall_uifile.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ PAGE_FFSYNC_REMOVE=$(/bin/cat<<EOF
4040
"subitems": [{
4141
"key": "wizard_mysql_password_root",
4242
"desc": "Root password",
43-
"invalidText": "Invalid password. Please ensure it has at least one uppercase letter, one lowercase letter, one digit, one special character, a minimum length of 10 characters, and does not contain the word 'root'.",
43+
"invalidText": "Password does not meet the current strength rules. The minimum password length is 10 characters and must include mixed case, numeric characters, and special characters; it must also exclude common passwords or using username as password.",
4444
"validator": {
4545
"fn": "$(getPasswordValidator)"
4646
}

0 commit comments

Comments
 (0)