Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
ad87442
feat: move activation code logic into the API
elibosley Apr 24, 2025
210c12a
chore: progress on paths handling
elibosley Apr 24, 2025
faa0085
chore: lint
elibosley Apr 24, 2025
25242a3
chore: activation code progress
elibosley Apr 24, 2025
cc5c94b
chore: cleanup activation code web logic
elibosley Apr 25, 2025
716d85c
chore: testing additions
elibosley Apr 25, 2025
30a6e19
chore: minor customization service fixes
elibosley Apr 25, 2025
bd39053
chore: minor test cleanup
elibosley Apr 25, 2025
6a81643
chore: cleanup legacy setup scripts
elibosley Apr 25, 2025
64f94d1
chore: update AC contents
elibosley Apr 25, 2025
224e916
chore: fix paths
elibosley Apr 25, 2025
54b85ea
chore: link partner logo into unraid logo location
elibosley Apr 25, 2025
3e354f2
chore: paths test fixed
elibosley Apr 25, 2025
0790525
chore: move to static hosting for testing
elibosley Apr 25, 2025
d7b3c69
chore: lint
elibosley Apr 25, 2025
1ca1f11
chore: fix header modification to just target the header logo
elibosley Apr 25, 2025
cd064a8
chore: stop modifying the header logo
elibosley Apr 25, 2025
d9b1b79
chore: more specific targeting
elibosley Apr 25, 2025
f1caf6d
chore: fix reload nginx on apply
elibosley Apr 25, 2025
8451fa8
chore: fix partner logo on login page
elibosley Apr 25, 2025
83b3269
chore: cleanup loader
elibosley Apr 25, 2025
895da1b
chore: lint
elibosley Apr 25, 2025
f480476
chore: proper emcmd logging
elibosley Apr 25, 2025
fbf4c2e
fix: test issues
elibosley Apr 25, 2025
815b085
chore: lint
elibosley Apr 25, 2025
7d780b2
chore: add precommit hooks
elibosley Apr 25, 2025
96dcfea
chore: max length activation code
elibosley Apr 25, 2025
aba57b9
chore: truncate server name to 15 characters
elibosley Apr 26, 2025
8f09e20
fix: use a sleep to wait for emhttp to come online
elibosley Apr 26, 2025
3c87afe
chore: try to manually load var when posting emcmd
elibosley Apr 26, 2025
5328afa
chore: add wait logic to emcmd
elibosley Apr 26, 2025
ef44164
fix: tests
elibosley Apr 26, 2025
57da8e1
fix: throw error on state loading failure
elibosley Apr 26, 2025
4ffa734
fix: null return
elibosley Apr 26, 2025
d6bef47
chore: fix unit tests
elibosley Apr 28, 2025
59602bb
chore: ujpdate tsts
elibosley Apr 28, 2025
bf5fa95
chore: santize partner name
elibosley Apr 28, 2025
8c162d9
chore: more cleanup
elibosley Apr 28, 2025
08f376e
chore: rename public endpoint key
elibosley Apr 28, 2025
1f102e1
chore: cleanup nulls
elibosley Apr 28, 2025
78729f5
chore: getState mock
elibosley Apr 28, 2025
88f8923
chore: move helper methods into the service
elibosley Apr 28, 2025
aded0fd
chore: make case dir file if it doesn't exist
elibosley Apr 28, 2025
80a1d4f
chore: fix test
elibosley Apr 29, 2025
b73b555
chore: always return data from partner info query
elibosley Apr 29, 2025
4965dc9
feat: welcome and activation modal responsive stepper
zackspear Apr 29, 2025
f224ad5
chore: move theme setting and fetching into the API
elibosley Apr 29, 2025
20e6448
chore: fix invalid import
elibosley Apr 29, 2025
0101b02
chore: hide header logo
elibosley Apr 29, 2025
96027d8
chore: move logo to header
elibosley Apr 30, 2025
f34715c
chore: hide unraid logo in defaultpagelayout
elibosley Apr 30, 2025
efc230c
chore: src as a binding
elibosley Apr 30, 2025
b616151
chore: add tailwind styles
elibosley Apr 30, 2025
adecec4
chore: fix object aspect ratio
elibosley Apr 30, 2025
b392795
chore: link in header
elibosley Apr 30, 2025
03a8591
chore: use execa to reload service
elibosley Apr 30, 2025
185d2d5
chore: debug log when reloading services
elibosley Apr 30, 2025
9f8f78e
chore: fix async call in root of component
elibosley Apr 30, 2025
7bb62cd
chore: add error typings
elibosley Apr 30, 2025
e14df40
chore: add public theme endpoint
elibosley Apr 30, 2025
c43debe
chore: fix theme
elibosley Apr 30, 2025
71f4562
chore: correctly call emhttpd
elibosley Apr 30, 2025
c9e5bd6
chore: more emcmd logging
elibosley Apr 30, 2025
74c6796
chore: emcmd
elibosley Apr 30, 2025
d27b3ad
chore: fix type error
elibosley Apr 30, 2025
96f94a7
chore: update disabled opacity in StepperItem component
zackspear Apr 30, 2025
08edadf
chore: add activationCodeData to purchase and server interfaces
zackspear Apr 30, 2025
6ff9ba7
chore: fix activation code types
elibosley May 1, 2025
d092318
chore: simplify path configuration
elibosley May 1, 2025
19db748
chore: fix unit tests
elibosley May 1, 2025
fda7165
chore: fix hasPartnerLogo check
elibosley May 1, 2025
9e6e3c2
chore: update snapshots
elibosley May 1, 2025
8ca44ba
chore: update @unraid/shared-callbacks version to 1.1.1 and bump rela…
zackspear May 1, 2025
d2e8e25
chore: remove type cast
elibosley May 1, 2025
a4087de
chore: fix inversion
elibosley May 1, 2025
8adb0d6
chore: update file modifier
elibosley May 1, 2025
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
5 changes: 3 additions & 2 deletions .cursor/rules/api-rules.mdc
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---
description:
globs: api/*
globs: api/**/*,api/*
alwaysApply: false
---

* pnpm ONLY
* always run scripts from api/package.json unless requested
* prefer adding new files to the nest repo located at api/src/unraid-api/ instead of the legacy code
* Test suite is VITEST, do not use jest
* Prefer to not mock simple dependencies
* Prefer to not mock simple dependencies

8 changes: 8 additions & 0 deletions .cursor/rules/default.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
description:
globs:
alwaysApply: true
---
Never add comments unless they are needed for clarity of function

Be CONCISE, keep replies shorter than a paragraph if at all passible.
12 changes: 12 additions & 0 deletions .husky/_/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

if [ "$SKIP_SIMPLE_GIT_HOOKS" = "1" ]; then
echo "[INFO] SKIP_SIMPLE_GIT_HOOKS is set to 1, skipping hook."
exit 0
fi

if [ -f "$SIMPLE_GIT_HOOKS_RC" ]; then
. "$SIMPLE_GIT_HOOKS_RC"
fi

pnpm lint-staged
2 changes: 2 additions & 0 deletions api/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ PATHS_KEYFILE_BASE=./dev/Unraid.net # Keyfile location
PATHS_MACHINE_ID=./dev/data/machine-id
PATHS_PARITY_CHECKS=./dev/states/parity-checks.log
PATHS_CONFIG_MODULES=./dev/configs
PATHS_ACTIVATION_BASE=./dev/activation
PATHS_PASSWD=./dev/passwd
ENVIRONMENT="development"
NODE_ENV="development"
PORT="3001"
Expand Down
2 changes: 2 additions & 0 deletions api/.env.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ PATHS_KEYFILE_BASE=./dev/Unraid.net # Keyfile location
PATHS_MACHINE_ID=./dev/data/machine-id
PATHS_PARITY_CHECKS=./dev/states/parity-checks.log
PATHS_CONFIG_MODULES=./dev/configs
PATHS_ACTIVATION_BASE=./dev/activation
PATHS_PASSWD=./dev/passwd
PORT=5000
NODE_ENV="test"
2 changes: 1 addition & 1 deletion api/dev/Unraid.net/myservers.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[api]
version="4.4.1"
version="4.7.0"
extraOrigins="https://google.com,https://test.com"
[local]
sandbox="yes"
Expand Down
13 changes: 13 additions & 0 deletions api/dev/activation/activation_code_12345.activationcode
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"code": "EXAMPLE_CODE_123",
"partnerName": "MyPartner Inc.",
"partnerUrl": "https://partner.example.com",
"serverName": "MyAwesomeServer",
"sysModel": "CustomBuild v1.0",
"comment": "This is a test activation code for development.",
"header": "#336699",
"headermetacolor": "#FFFFFF",
"background": "#F0F0F0",
"showBannerGradient": "yes",
"theme": "black"
}
1 change: 1 addition & 0 deletions api/dev/activation/applied.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
true
Binary file added api/dev/activation/assets/case-model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions api/dev/activation/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 1 addition & 21 deletions api/dev/configs/connect.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
{
"demo": "2025-04-21T14:27:27.631Z",
"wanaccess": "yes",
"wanport": "8443",
"upnpEnabled": "no",
"apikey": "_______________________BIG_API_KEY_HERE_________________________",
"localApiKey": "_______________________LOCAL_API_KEY_HERE_________________________",
"email": "test@example.com",
"username": "zspearmint",
"avatar": "https://via.placeholder.com/200",
"regWizTime": "1611175408732_0951-1653-3509-FBA155FA23C0",
"accesstoken": "",
"idtoken": "",
"refreshtoken": "",
"dynamicRemoteAccessType": "DISABLED",
"ssoSubIds": "",
"version": "4.6.6",
"extraOrigins": [
"https://google.com",
"https://test.com"
],
"sandbox": "yes"
"demo": "hello.unraider"
}
74 changes: 40 additions & 34 deletions api/dev/dynamix/dynamix.cfg
Original file line number Diff line number Diff line change
@@ -1,36 +1,42 @@
[display]
date="%c"
time="%I:%M %p"
number=".,"
scale="-1"
tabs="1"
users="Tasks:3"
resize="0"
wwn="0"
total="1"
usage="0"
banner="image"
dashapps="icons"
theme="white"
text="1"
unit="C"
warning="70"
critical="90"
hot="45"
max="55"
sysinfo="/Tools/SystemProfiler"
date=%c
time=%I:%M %p
number=.,
scale=-1
tabs=1
users=Tasks:3
resize=0
wwn=0
total=1
usage=0
banner=image
dashapps=icons
theme=black
text=1
unit=C
warning=70
critical=90
hot=45
max=55
sysinfo=/Tools/SystemProfiler
header=336699
headermetacolor=FFFFFF
background=F0F0F0
showBannerGradient=yes

[notify]
entity="1"
normal="1"
warning="1"
alert="1"
unraid="1"
plugin="1"
docker_notify="1"
report="1"
display="0"
date="d-m-Y"
time="H:i"
position="top-right"
path="./dev/notifications"
system="*/1 * * * *"
entity=1
normal=1
warning=1
alert=1
unraid=1
plugin=1
docker_notify=1
report=1
display=0
date=d-m-Y
time=H:i
position=top-right
path=./dev/notifications
system=*/1 * * * *

36 changes: 36 additions & 0 deletions api/dev/ident.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Generated settings:
NAME="Unraid"
timeZone="America/New_York"
COMMENT="Media server"
SECURITY="user"
WORKGROUP="WORKGROUP"
DOMAIN=""
DOMAIN_SHORT=""
hideDotFiles="no"
enableFruit="yes"
USE_NETBIOS="no"
localMaster="yes"
serverMultiChannel="no"
USE_WSD="yes"
WSD_OPT=""
WSD2_OPT=""
USE_NTP="yes"
NTP_SERVER1="time1.google.com"
NTP_SERVER2="time2.google.com"
NTP_SERVER3="time3.google.com"
NTP_SERVER4="time4.google.com"
DOMAIN_LOGIN="Administrator"
DOMAIN_PASSWD=""
SYS_MODEL="Custom"
SYS_ARRAY_SLOTS="24"
USE_SSL="yes"
PORT="80"
PORTSSL="8443"
LOCAL_TLD="local"
BIND_MGT="no"
USE_TELNET="no"
PORTTELNET="23"
USE_SSH="yes"
PORTSSH="22"
USE_UPNP="yes"
START_PAGE="Main"
1 change: 1 addition & 0 deletions api/dev/states/var.ini
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ regTm="1833409182"
regTm2="0"
regExp=""
regGen="0"
regState="ENOKEYFILE"
sbName="/boot/config/super.dat"
sbVersion="2.9.13"
sbUpdated="1596079143"
Expand Down
1 change: 1 addition & 0 deletions api/dev/webGui/images/UN-logotype-gradient.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 70 additions & 7 deletions api/generated-schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,7 @@ type Permission {

"""Available resources for permissions"""
enum Resource {
ACTIVATION_CODE
API_KEY
ARRAY
CLOUD
Expand Down Expand Up @@ -937,6 +938,70 @@ type Config implements Node {
error: String
}

type PublicPartnerInfo {
partnerName: String

"""Indicates if a partner logo exists"""
hasPartnerLogo: Boolean!
partnerUrl: String

"""
The path to the partner logo image on the flash drive, relative to the activation code file
"""
partnerLogoUrl: String
}

type ActivationCode {
code: String
partnerName: String
partnerUrl: String
serverName: String
sysModel: String
comment: String
header: String
headermetacolor: String
background: String
showBannerGradient: Boolean
theme: String
}

type Customization {
activationCode: ActivationCode
partnerInfo: PublicPartnerInfo
theme: Theme!
}

type Theme {
"""The theme name"""
name: ThemeName!

"""Whether to show the header banner image"""
showBannerImage: Boolean!

"""Whether to show the banner gradient"""
showBannerGradient: Boolean!

"""The background color of the header"""
headerBackgroundColor: String!

"""Whether to show the description in the header"""
showHeaderDescription: Boolean!

"""The text color of the header"""
headerPrimaryTextColor: String!

"""The secondary text color of the header"""
headerSecondaryTextColor: String
}

"""The theme name"""
enum ThemeName {
azure
black
gray
white
}

type InfoApps implements Node {
id: PrefixedID!

Expand Down Expand Up @@ -1033,7 +1098,7 @@ type Display implements Node {
usage: Boolean
banner: String
dashapps: String
theme: Theme
theme: ThemeName
text: Boolean
unit: Temperature
warning: Int
Expand All @@ -1043,11 +1108,6 @@ type Display implements Node {
locale: String
}

"""Display theme"""
enum Theme {
white
}

"""Temperature unit (Celsius or Fahrenheit)"""
enum Temperature {
C
Expand Down Expand Up @@ -1203,7 +1263,7 @@ type DockerContainer implements Node {
"""
The `JSONObject` scalar type represents JSON objects as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).
"""
scalar JSONObject
scalar JSONObject @specifiedBy(url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf")

enum ContainerState {
RUNNING
Expand Down Expand Up @@ -1423,6 +1483,9 @@ type Query {
connect: Connect!
remoteAccess: RemoteAccess!
extraAllowedOrigins: [String!]!
customization: Customization
publicPartnerInfo: PublicPartnerInfo
publicTheme: Theme!
docker: Docker!
disks: [Disk!]!
disk(id: PrefixedID!): Disk!
Expand Down
Loading
Loading