@ugurkocde/intuneget-packager
v1.1.0
Published
Local Windows packager service for IntuneGet - enables true self-hosting without GitHub Actions dependency
Maintainers
Readme
IntuneGet Packager
Local Windows packaging service for IntuneGet - enables true self-hosting without GitHub Actions dependency.
Overview
The IntuneGet Packager is a Node.js application that runs on Windows and handles:
- Polling for packaging jobs from the database
- Downloading application installers
- Creating PSADT (PowerShell App Deployment Toolkit) packages
- Converting packages to
.intunewinformat using IntuneWinAppUtil.exe - Uploading packages to Microsoft Intune via Graph API
Requirements
- Windows 10/11 or Windows Server 2019+
- Node.js 18 or higher
- Network access to:
- Your Supabase database
- Microsoft Graph API (graph.microsoft.com)
- Application installer URLs
Installation
Option 1: Install globally via npm
npm install -g @ugurkocde/intuneget-packagerOption 2: Use npx without installing
npx @ugurkocde/intuneget-packagerConfiguration
Create a .env file in your working directory or set environment variables:
Required Variables
# Supabase Connection
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
# Azure AD / Microsoft Entra ID
AZURE_CLIENT_ID=your-app-registration-client-id
AZURE_CLIENT_SECRET=your-app-registration-client-secretOptional Variables
# Packager Identity (auto-generated if not set)
PACKAGER_ID=my-packager-01
# Polling Configuration
POLL_INTERVAL=5000 # Milliseconds between polls (default: 5000)
STALE_JOB_TIMEOUT=300000 # Consider job stale after this many ms (default: 5 min)
# Directory Paths
WORK_DIR=./work # Working directory for packages
TOOLS_DIR=./tools # Tools directory (IntuneWinAppUtil, PSADT)
# Web App API (optional)
WEB_APP_URL=https://your-intuneget-instance.comUsage
Start the packager
# Using globally installed package
intuneget-packager
# Using npx
npx @ugurkocde/intuneget-packager
# With verbose logging
intuneget-packager --verbose
# With debug logging
intuneget-packager --debug
# Dry run (validate config without processing)
intuneget-packager --dry-runCheck configuration
intuneget-packager checkDownload tools
intuneget-packager setupArchitecture
+-------------------+
| IntuneGet |
| Web App |
+--------+----------+
|
| Creates jobs
v
+---------------------------+ +--------+----------+
| IntuneGet Packager | | Supabase |
| (this service) | <---> | Database |
| - Polls for jobs | | |
| - Processes packages | +-------------------+
| - Uploads to Intune |
+------------+--------------+
|
| Uploads via Graph API
v
+---------------------------+
| Microsoft Intune |
| (tenant) |
+---------------------------+How It Works
- Web App creates a packaging job in the database with status
queued - Packager polls the database every 5 seconds for queued jobs
- Packager atomically claims a job (updates status to
packaging) - Packager downloads the installer, creates PSADT package, and converts to
.intunewin - Packager uploads the package to Intune via Microsoft Graph API
- Packager updates job status to
deployedwith Intune app ID and URL
Scaling
You can run multiple packager instances for increased throughput:
- Each packager has a unique ID (auto-generated or configured)
- Jobs are claimed atomically (only one packager processes each job)
- Stale jobs (claimed but no heartbeat) are automatically recovered
Running as a Windows Service
For production deployments, you may want to run the packager as a Windows service:
Using NSSM (Non-Sucking Service Manager)
- Download NSSM from https://nssm.cc/
- Install the service:
nssm install IntuneGetPackager "C:\Program Files\nodejs\node.exe" "C:\path\to\node_modules\@intuneget\packager\dist\index.js"
nssm set IntuneGetPackager AppDirectory "C:\IntuneGet"
nssm set IntuneGetPackager AppStdout "C:\IntuneGet\logs\packager.log"
nssm set IntuneGetPackager AppStderr "C:\IntuneGet\logs\packager-error.log"
nssm start IntuneGetPackagerUsing PM2
- Install PM2:
npm install -g pm2 - Start the packager:
pm2 start intuneget-packager --name "intuneget-packager"
pm2 save
pm2 startupTroubleshooting
Common Issues
"Configuration issues found"
- Run
intuneget-packager checkto see detailed configuration errors - Ensure all required environment variables are set
"Failed to acquire access token"
- Verify AZURE_CLIENT_ID and AZURE_CLIENT_SECRET are correct
- Ensure the app registration has DeviceManagementApps.ReadWrite.All permission
- Check that admin consent has been granted for the target tenant
"IntuneWinAppUtil.exe not found"
- Run
intuneget-packager setupto download required tools - Or manually place IntuneWinAppUtil.exe in the tools directory
Jobs not being picked up
- Ensure PACKAGER_MODE=local is set in your web app's configuration
- Check that SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY match between web app and packager
Logs
The packager logs to stdout/stderr. Use --verbose or --debug for more detailed logging.
Security Considerations
- The packager uses the Supabase service role key for database access
- Keep the
.envfile secure and never commit it to version control - The AZURE_CLIENT_SECRET should be rotated regularly
- Consider running the packager on a dedicated machine or container
License
MIT
