mosen / jcdssync

JAMF Pro JCDS to local DP sync utility
3 stars 0 forks source link

Reliance on old python-jss? #2

Open staze opened 4 years ago

staze commented 4 years ago

Trying to get this to work, and it seems like it might rely on an older python-jss (Looks like jcds support was removed... https://github.com/jssimporter/JSSImporter/issues/152).

mosen commented 4 years ago

Yep. when i wrote jamfcloud native uploads into python-jss it was hit and miss. Some packages would stay in pending forever, so they pulled it from JSSImporter. Until JAMF supply an upload API im not sure if i could make this solution stable.

staze commented 4 years ago

bummer. know of any other options for making something like this work? trying to get cloud dp sync'd down to on-prem in an automated fashion (so on-prem devices pull from the on-prem DPs).

Thanks!

mosen commented 4 years ago

A dumb way might be to enroll a mac and have every package in the policy listed as cached, then share the package cache out as a DP

staze commented 4 years ago

🤮

I've seen that mentioned elsewhere. gah.

gandalf239 commented 5 months ago

Uploads to Jamf cloud via API are very much working now, ala:

!/bin/zsh

apiUsername=your_api_user

apiPassword=your_api_password

jssServer=https://your.jss.com:443 (or 8443 if onprem)

request auth token

authToken=$( /usr/bin/curl \

--request POST \

--silent \

--url "$jssServer/api/v1/auth/token" \

--user "$apiUsername:$apiPassword" )

echo "$authToken"

parse auth token

token=$( /usr/bin/plutil \

-extract token raw - <<< "$authToken" )

tokenExpiration=$( /usr/bin/plutil \

-extract expires raw - <<< "$authToken" )

localTokenExpirationEpoch=$( TZ=GMT /bin/date -j \

-f "%Y-%m-%dT%T" "$tokenExpiration" \

+"%s" 2> /dev/null )

echo Token: "$token"

echo Expiration: "$tokenExpiration"

echo Expiration epoch: "$localTokenExpirationEpoch"

curl -L -o digitPackageName.pkg -H "Authorization: Bearer $token" 'https://your.jss.com:443/JSSResource/packages/digitPackageName.pkg' -X POST

mosen commented 5 months ago

Yeah I'm sorry guys I don't even have jamf anymore so should probably archive the project. There's no way I can even get access