3. Configuration#
The connector reads its configuration from two places.
The settings file /etc/asm-connections.json holds the Apple School
Manager accounts,
the schools that the connector synchronizes to each of them,
and every setting that controls which users the connector exports
and how it maps their attributes.
The app settings in the App Center hold the synchronization schedule
and a few switches for everyday operation.
Caution
Apple School Manager uses the email address of a user as the Apple Account. Make sure that every synchronized user has a primary email address. Apple School Manager can’t create an account for a user without one. See Email addresses.
3.1. Settings file#
The settings file /etc/asm-connections.json has three sections:
accountsThe Apple School Manager accounts, each with its credentials and the settings for the students and teachers that the account receives. See Apple School Manager accounts.
schoolsThe schools to synchronize, each with the account that receives it and the settings for its classes. See Schools.
defaultsSettings that apply to every account and every school, unless an account or a school entry sets them itself. See Defaults.
{
"accounts": {
"north": {
"username": "sftp-user-north",
"password_file": "/etc/asm-north.secret"
},
"south": {
"username": "sftp-user-south",
"password_file": "/etc/asm-south.secret",
"student": {"anonymize": false}
}
},
"defaults": {
"student": {"password_policy": 6}
},
"schools": {
"gym123": {"account": "north"},
"gs456": {
"account": "south",
"course_name_pattern": "{name}",
"student": {"ldap_filter": "(uid=a*)"}
}
}
}
A student or teacher who belongs to several schools of the same account appears only once in the upload to that account. The settings for students and teachers therefore apply per account, and the settings for classes and the LDAP filters apply per school.
For every setting,
the connector uses the value from the account or school entry,
then the value from defaults,
and then the built-in default.
The installation creates the file
with read permission for the root user only.
Edit it with a text editor.
The connector reads the file at the start of each run,
so a change takes effect with the next synchronization.
It checks the complete file before it uploads anything.
The following problems stop the run with an error message
that names the file and the entry:
A missing file, or a file without an account or a school.
A missing or unknown key, or a value of the wrong type.
A school that refers to an account that the file doesn’t define.
A missing or empty password file.
A user name that appears for more than one account.
A school that doesn’t exist, if the file has the entry
*. A misspelled school would otherwise send its users to the account of that entry.No account that receives an existing school.
The following problems only write a warning to the log file. The connector uploads to the remaining accounts:
An account that no school refers to. The account receives no upload.
A school that doesn’t exist, if the file has no entry
*. An account without any existing school receives no upload.
If the upload to one account fails, the connector still uploads to the remaining accounts and exits with a non-zero status at the end.
3.1.1. Apple School Manager accounts#
The accounts section maps a name of your choice to each account.
The name may only contain letters, digits, ., _, and -.
Usually there is a single account.
If the schools on your UCS@school system belong to different institutions,
each with its own Apple School Manager account,
add one entry per account.
The connector then uploads a separate archive to every account,
each restricted to the schools that refer to that account.
To add an account:
Store the SFTP password of the account in a file of its own that only
rootcan read. Obtain the SFTP credentials describes where to find the password. Every account has its own SFTP credentials, so every account needs its own password file. The examples name the file after the account, such as/etc/asm-north.secret. The account from Enter the credentials can keep/etc/asm.secret.$ install -m 600 /dev/null /etc/asm-north.secret $ editor /etc/asm-north.secret
Add the account to the
accountssection of the settings file.Assign at least one school to the account, as described in Schools.
An account entry takes the following keys.
All keys except username and password_file are optional
and can also go to defaults.
Key |
Default |
Description |
|---|---|---|
|
Required |
The SFTP user name of the account. |
|
Required |
Path to the file that holds the SFTP password of the account. |
|
Empty |
See Email addresses. |
|
|
See Anonymization. |
|
See Anonymization |
See Anonymization. |
|
|
|
|
|
|
|
|
3.1.2. Schools#
The schools section lists the schools to synchronize
by their abbreviation
and assigns each of them to an account.
The connector only synchronizes schools that the section lists.
To look up the abbreviations,
open in UMC.
The abbreviation is the name of the school object, for example gym123.
The entry * stands for every school that the section doesn’t list by name.
With a single account,
it synchronizes all schools to that account.
If the section lists a school that doesn’t exist,
the connector stops before it uploads anything.
Otherwise a misspelled school would go to the account of the entry *
instead of the account you meant.
"schools": {
"*": {"account": "north"},
"gym123": {
"account": "north",
"staff": {"ldap_filter": "(uid=t*)"}
}
}
A student or teacher who belongs to several schools appears in the upload to an account only with the schools that belong to that account. If none of their schools belongs to the account, the connector skips them for that account.
A school entry takes the following keys.
All keys except account are optional
and can also go to defaults.
Key |
Default |
Description |
|---|---|---|
|
Required |
Name of the account in the |
|
|
|
|
|
|
|
Empty |
3.1.3. Defaults#
The defaults section takes every optional key of an account entry
and of a school entry.
A value in defaults applies to every account or every school
that doesn’t set the key itself.
"defaults": {
"student": {"anonymize": false},
"staff": {"anonymize": false}
},
"accounts": {
"north": {
"username": "sftp-user-north",
"password_file": "/etc/asm-north.secret",
"student": {"anonymize": true}
}
}
3.1.4. Update from an earlier version#
Up to version 5.1.1,
app settings and UCR variables held the configuration.
The update to version 6.0.0 moves their values to the settings file
and removes the UCR variables.
You don’t need to do anything.
The password stays in /etc/asm.secret,
and the settings file refers to it.
The account gets the name default.
Former setting |
Key in the settings file |
|---|---|
|
|
|
|
|
One entry per school in |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Replace ROLE with staff or student,
ATTRIBUTE with an attribute from Anonymization,
and SCHOOL with the school abbreviation.
The update drops an LDAP filter for a school that wasn’t on the former school list, because the connector didn’t synchronize that school. It also leaves out schools that don’t exist any more, both from the former school list and from the LDAP filters, and prints a note for each of them.
Without asm/username,
the update has no account to assign schools to.
It keeps asm/school_whitelist
and the asm/ldap_filter/students/SCHOOL and asm/ldap_filter/staff/SCHOOL UCR variables
and prints a note for each of them.
Move their values to the settings file
when you add the account.
If /etc/asm-connections.json already exists,
the update leaves it and the UCR variables unchanged.
3.2. App settings#
To open the app settings, select the app in the App Center and click App settings. The app settings apply to every account alike.
Setting |
Default |
Description |
|---|---|---|
|
|
Run the synchronization once a day. See Schedule the synchronization. |
|
Unset |
The hour of the day at which the daily synchronization runs.
Valid values are |
|
|
Run the synchronization immediately after you save the app settings. |
|
|
Keep the uploaded ZIP archive in |
|
Unset |
Read-only status field. Shows when the connector last uploaded an archive to any account. |
|
Unset |
Shows when the connector last uploaded an archive to the account |
3.3. Schedule the synchronization#
The connector doesn’t run on its own. Either you run it manually, as described in Run the synchronization, or you let a cron job run it once a day.
To enable the daily run:
Open the app settings.
Select asm/sync_daily.
Select the hour in asm/sync_daily/hour.
Click Apply changes.
The connector writes the cron job to /etc/cron.d/asm-upload.
The job runs at minute 0 of the selected hour.
If you enable the daily run without a valid hour,
the connector writes a comment to the cron file instead of a job,
and no synchronization takes place.
3.4. Settings in detail#
The following sections describe the optional keys of the settings file.
Keys that start with student or staff
go into an object of that name,
as in "student": {"anonymize": false}.
3.4.1. Email addresses#
Apple School Manager uses the email address of a user as the Apple Account. The connector exports the primary email address of each user in UCS@school. Users without one are exported without an email address, and Apple School Manager can’t create an Apple Account for them.
email_prepend_domainPer account. Inserts the value as a subdomain in front of the domain of every email address. With the value
apple, the connector exports the addressjane@example.comasjane@apple.example.com. Default: empty.
3.4.2. Anonymization#
If you don’t want to transfer the names and email addresses of your users,
you can anonymize them.
Anonymization replaces the values of the attributes first_name,
middle_name, last_name, email_address, and sis_username
with values that you configure.
Caution
An anonymized user has no email address, unless you configure a replacement value for it. Without an email address, Apple School Manager can’t create an Apple Account for the user.
Anonymization and the Keycloak as identity provider for ASM setup exclude each other. If you use Keycloak as an identity provider for Apple School Manager, turn anonymization off.
student.anonymize,staff.anonymizePer account. Enables anonymization for students and teachers. Default:
true.student.anonymize_values,staff.anonymize_valuesPer account. Replacement values for the anonymized attributes. A value that starts with
%names an LDAP attribute, and the connector exports the value of that attribute from the user’s LDAP object. A value without a leading%is exported literally.nullleaves the column empty. You only need to list the attributes whose default you want to change.
Key in |
Default |
Required |
|---|---|---|
|
|
Yes |
|
|
No |
|
|
Yes |
|
|
No |
|
|
No |
"student": {
"anonymize": true,
"anonymize_values": {"last_name": "Student"}
}
3.4.3. Identification of users#
Apple School Manager identifies a user by the person_id column.
The connector fills it with an LDAP attribute of the user
that doesn’t change when you rename the user.
student.person_id_attribute,staff.person_id_attributePer account. LDAP attribute that identifies a student or a teacher. Default:
entryUUID.
Caution
Don’t change these keys on a running installation.
Apple School Manager treats a user with a new person_id
as a different user
and loses the association with the existing account.
3.4.4. Password policy for students#
Apple School Manager creates the password for a new student itself. The password policy determines how long that password is.
student.password_policyPer account. Length of the password that Apple creates for a new student. Valid values are
4,6,8, andnull.nullmeans that Apple School Manager uses the default of the school. Default:4.
Apple School Manager doesn’t support a password policy for teachers.
3.4.5. Grade level of students#
student.grade_level_attributePer account. LDAP attribute that holds the grade level of a student. The connector exports its value in the
grade_levelcolumn. Default:null, which leaves the column empty.
3.4.6. Names of courses and classes#
UCS@school prefixes the name of a school class with the school abbreviation,
for example gym123-1a.
The connector derives the course name from that name.
course_name_patternPer school. Pattern for the course name. The connector replaces
{ou}with the school abbreviation and{name}with the class name without the school prefix. Default:{ou}-{name}.class_number_emptyPer school. Leaves the
class_numbercolumn empty. Apple School Manager builds the name of a class from the course name and the class number, so an identical class number only repeats the course name. Default:true.
3.4.7. Select users with an LDAP filter#
If the school list from Schools isn’t fine-grained enough, you can select the users with an LDAP filter. The connector applies the filter in addition to the school list.
student.ldap_filter,staff.ldap_filterPer school. LDAP filter for the students or the teachers of the school. A filter in
defaultsapplies to every school that doesn’t set its own. Default: empty, which selects every user.
"gym123": {
"account": "north",
"student": {"ldap_filter": "(mailPrimaryAddress=*)"}
}
The connector combines the filter with its own selection of the students or teachers of the school, so the filter only needs to describe the attributes of the users you want. To check which users a filter selects before you set it, combine it with the role of the users and run it with univention-ldapsearch:
$ univention-ldapsearch -LLL \
'(&(ucsschoolRole=student:school:gym123)(mailPrimaryAddress=*))' uid
Caution
An invalid LDAP filter stops the upload to the account of that school. The connector uploads nothing to that account in that case, so its data in Apple School Manager stays as it was after the last successful run. The other accounts still receive their upload.