{"id":25874049,"url":"https://github.com/zone-eu/mobileconfig","last_synced_at":"2025-04-04T18:02:17.386Z","repository":{"id":36837292,"uuid":"41144198","full_name":"zone-eu/mobileconfig","owner":"zone-eu","description":"Create and sign iOS mobileconfig configuration files","archived":false,"fork":false,"pushed_at":"2025-02-28T08:39:06.000Z","size":76,"stargazers_count":168,"open_issues_count":5,"forks_count":45,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-28T11:11:52.229Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zone-eu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-08-21T08:16:06.000Z","updated_at":"2025-02-28T08:39:07.000Z","dependencies_parsed_at":"2024-06-18T15:29:27.795Z","dependency_job_id":"e6c9174c-77bf-4b98-b22f-b33dc109171f","html_url":"https://github.com/zone-eu/mobileconfig","commit_stats":{"total_commits":22,"total_committers":8,"mean_commits":2.75,"dds":0.5454545454545454,"last_synced_commit":"16aa4014f68c4306672ba26a3badc8a90459aa49"},"previous_names":["zone-eu/mobileconfig"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zone-eu%2Fmobileconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zone-eu%2Fmobileconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zone-eu%2Fmobileconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zone-eu%2Fmobileconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zone-eu","download_url":"https://codeload.github.com/zone-eu/mobileconfig/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226210,"owners_count":20904465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-02T09:05:42.411Z","updated_at":"2025-04-04T18:02:17.355Z","avatar_url":"https://github.com/zone-eu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mobileconfig\n\nCreate and sign iOS _mobileconfig_ configuration files.\n\nCurrently the module is able to auto configure and sign the following configuration payloads:\n\n-   `com.apple.mail.managed ` eg. e-mail accounts (IMAP only at this point)\n\nPayload signing is handled by [jsrsasign](http://kjur.github.io/jsrsasign/) which is a JavaScript only crypto library. This means that you can generate your _mobileconfig_ files even in Windows.\n\n## Usage\n\nRequire the module\n\n```javascript\nconst mobileconfig = require('mobileconfig');\n```\n\n### Generate and sign Email configuration\n\nGenerate and sign Email account configuration with\n\n```javascript\nmobileconfig.getSignedEmailConfig(options, callback);\n```\n\nWhere\n\n-   **options** is the options object for the account data with following properties\n    -   **emailAddress** is the address to be configured\n    -   **organization** is an optional name of the signing organization\n    -   **identifier** is a reverse-DNS style identifier (eg. _com.example.myprofile_) for the profile\n    -   **displayName** is an optional name for the profile\n    -   **displayDescription** is a optional description for the profile\n    -   **accountName** is an optional name for the email account\n    -   **accountDescription** is an optional description for the email account\n    -   **imap** is the incoming IMAP configuration data with the following properties\n        -   **hostname** is the hostname of the server\n        -   **port** is an optional port number for the server (standard port is used if not set)\n        -   **secure** is a boolean that indicates if the server should use TLS/SSL (true) or not (false) when connecting (does not affect STARTTLS usage)\n        -   **username** is the username of the email account\n        -   **password** is the password for the account\n    -   **smtp** is the outgoing SMTP configuration data\n        -   **hostname** is the hostname of the server\n        -   **port** is an optional port number for the server (standard port is used if not set)\n        -   **secure** is a boolean that indicates if the server should use TLS/SSL (true) or not (false) when connecting (does not affect STARTTLS usage)\n        -   **username** is the username of the email account. If missing then no authentication is used for SMTP\n        -   **password** is the password for the account. If missing then IMAP password is used for SMTP as well\n    -   **keys** includes the key and the certificate for signing the configuration file. See [signing configuration](#signing-configuration) for details of this object\n-   **callback** (_err_, _data_) is the callback function to run once the configuration is generated. _err_ is an Error object that is returned if an error occurs. _data_ is the signed DER file as Buffer object, store it as _name.mobileconfig_ to use\n\n### Generate and sign CardDAV configuration\n\nGenerate and sign CardDAV configuration with\n\n```javascript\nmobileconfig.getSignedCardDAVConfig(options, callback);\n```\n\nWhere\n\n-   **options** is the options object for the account data with following properties\n    -   **organization** is an optional name of the signing organization\n    -   **identifier** is a reverse-DNS style identifier (eg. _com.example.myprofile_) for the profile\n    -   **displayName** is an optional name for the profile\n    -   **displayDescription** is a optional description for the profile\n    -   **accountName** is an optional name for the CardDAV account\n    -   **accountDescription** is an optional description for the CardDAV account\n    -   **dav** is the dav server configuration with the following properties\n        -   **hostname** is the hostname of the server\n        -   **port** is an optional port number for the server (standard port is used if not set)\n        -   **secure** is a boolean that indicates if the server should use TLS/SSL (true) or not (false) when connecting\n        -   **principalurl** is an URL for the currently authenticated user’s principal resource on the server\n        -   **username** is the username of the email account\n        -   **password** is the password for the account\n-   **callback** (_err_, _data_) is the callback function to run once the configuration is generated. _err_ is an Error object that is returned if an error occurs. _data_ is the signed DER file as Buffer object, store it as _name.mobileconfig_ to use\n\n### Generate and sign CalDAV configuration\n\nGenerate and sign CalDAV configuration with\n\n```javascript\nmobileconfig.getSignedCalDAVConfig(options, callback);\n```\n\nWhere\n\n-   **options** is the options object for the account data with following properties\n    -   **organization** is an optional name of the signing organization\n    -   **identifier** is a reverse-DNS style identifier (eg. _com.example.myprofile_) for the profile\n    -   **displayName** is an optional name for the profile\n    -   **displayDescription** is a optional description for the profile\n    -   **accountName** is an optional name for the CalDAV account\n    -   **accountDescription** is an optional description for the CalDAV account\n    -   **dav** is the dav server configuration with the following properties\n        -   **hostname** is the hostname of the server\n        -   **port** is an optional port number for the server (standard port is used if not set)\n        -   **secure** is a boolean that indicates if the server should use TLS/SSL (true) or not (false) when connecting\n        -   **principalurl** is an URL for the currently authenticated user’s principal resource on the server\n        -   **username** is the username of the email account\n        -   **password** is the password for the account\n-   **callback** (_err_, _data_) is the callback function to run once the configuration is generated. _err_ is an Error object that is returned if an error occurs. _data_ is the signed DER file as Buffer object, store it as _name.mobileconfig_ to use\n\n### Generate and sign WiFi configuration\n\nGenerate and sign WiFi configuration with\n\n```javascript\nmobileconfig.getSignedWifiConfig(options, callback);\n```\n\nWhere\n\n-   **options** is the options object for the account data with following properties\n    -   **organization** is an optional name of the signing organization\n    -   **displayName** is an optional name for the profile\n    -   **wifi** is the required wifi configuration with the following properties\n        -   **encryptionType** encryption type of the wifi network (e.g WPA)\n        -   **ssid** wifi network ssid\n        -   **password** string password for the wifi network\n-   **keys** includes the key and the certificate for signing the configuration file. See [signing configuration](#signing-configuration) for details of this object\n-   **callback** (_err_, _data_) is the callback function to run once the configuration is generated.\n\n### Generate and sign any configuration\n\nGenerate and sign any valid mobileconfig configuration object. See [ConfigurationProfile reference](https://developer.apple.com/library/content/featuredarticles/iPhoneConfigurationProfileRef/Introduction/Introduction.html) for details.\n\n```javascript\nmobileconfig.getSignedConfig(plistData, keys, callback);\n```\n\nWhere\n\n-   **plistData** is an object of plist fields, see below for an example\n-   **keys** includes the key and the certificate for signing the configuration file. See [signing configuration](#signing-configuration) for details of this object\n-   **callback** (_err_, _data_) is the callback function to run once the configuration is generated. _err_ is an Error object that is returned if an error occurs. _data_ is the signed DER file as Buffer object, store it as _name.mobileconfig_ to use\n\n**Example**\n\nThis example demonstrates generating and signing a profile file for an IMAP account.\n\n```javascript\nmobileconfig.getSignedConfig([\n    PayloadType: 'Configuration',\n    PayloadVersion: 1,\n    PayloadIdentifier: 'com.my.company',\n    PayloadUUID: uuid.v4(),\n    PayloadDisplayName: 'My Gmail Account',\n    PayloadDescription: 'Install this profile to auto configure your email account',\n    PayloadOrganization: 'My Company',\n\n    PayloadContent: {\n        PayloadType: 'com.apple.mail.managed',\n        PayloadVersion: 1,\n        PayloadIdentifier: 'com.my.company',\n        PayloadUUID: uuid.v4(),\n        PayloadDisplayName: 'IMAP Config',\n        PayloadDescription: 'Configures email account',\n        PayloadOrganization: 'My Company',\n\n        EmailAccountDescription: 'Configure your email account',\n        EmailAccountName: 'John Smith',\n        EmailAccountType: 'EmailTypeIMAP',\n        EmailAddress: 'my-email-address@gmail.com',\n        IncomingMailServerAuthentication: 'EmailAuthPassword',\n        IncomingMailServerHostName: 'imap.gmail.com',\n        IncomingMailServerPortNumber: 993,\n        IncomingMailServerUseSSL: true,\n        IncomingMailServerUsername: 'my-email-address@gmail.com',\n        IncomingPassword: 'verysecret',\n        OutgoingPasswordSameAsIncomingPassword: true,\n        OutgoingMailServerAuthentication: 'EmailAuthPassword',\n        OutgoingMailServerHostName: 'smtp.gmail.com',\n        OutgoingMailServerPortNumber: 587,\n        OutgoingMailServerUseSSL: false,\n        OutgoingMailServerUsername: 'my-email-address@gmail.com',\n        PreventMove: false,\n        PreventAppSheet: false,\n        SMIMEEnabled: false,\n        allowMailDrop: true\n    }\n], {\n    key: '-----BEGIN PRIVATE KEY-----...',\n    cert: '-----BEGIN CERTIFICATE-----...'\n}, callback)\n```\n\n### Signing configuration\n\nSigning configuration object defines the signing process and includes the following properties\n\n-   **key** is the private key in PEM format\n-   **cert** is the certificate in PEM format to use\n-   **ca** is an array of certificate authority certs in PEM format\n-   **hashAlg** defines the hash algorithm\n    -   _\"sha256\"_ (default)\n    -   _\"sha512\"_\n    -   _\"sha384\"_\n    -   _\"sha224\"_\n    -   _\"sha1\"_\n    -   _\"md5\"_\n    -   _\"ripemd160\"_\n-   **sigAlg** defines the signature algorithm\n    -   _\"SHA256withRSA\"_ (default)\n    -   _\"SHA512withRSA\"_\n    -   _\"SHA384withRSA\"_\n    -   _\"SHA224withRSA\"_\n    -   _\"SHA1withRSA\"_\n    -   _\"MD5withRSA\"_\n    -   _\"RIPEMD160withRSA\"_\n    -   _\"SHA256withECDSA\"_\n    -   _\"SHA512withECDSA\"_\n    -   _\"SHA384withECDSA\"_\n    -   _\"SHA224withECDSA\"_\n    -   _\"SHA1withECDSA\"_\n    -   _\"SHA256withSA\"_\n    -   _\"SHA512withSA\"_\n    -   _\"SHA384withSA\"_\n    -   _\"SHA224withSA\"_\n    -   _\"SHA1withDSA\"_\n\n\u003e **NB** You can use the same key and cert that you use for your HTTPS server. If the certificate is valid, then the profile is displayed as \"Verified\" in a green font, otherwise it is displayed as \"Unverified\"/\"Not Verified\" in a red font.\n\n## Example\n\n```javascript\nconst mobileconfig = require('mobileconfig');\nconst options = {\n    emailAddress: 'my-email-address@gmail.com',\n    identifier: 'com.my.company',\n    imap: {\n        hostname: 'imap.gmail.com',\n        secure: true,\n        username: 'my-email-address@gmail.com',\n        password: 'mypass'\n    },\n    smtp: {\n        hostname: 'smtp.gmail.com',\n        port: 587,\n        secure: false,\n        username: 'my-email-address@gmail.com',\n        password: false // use the same password as for IMAP\n    },\n    keys: {\n        key: '-----BEGIN PRIVATE KEY-----...',\n        cert: '-----BEGIN CERTIFICATE-----...'\n    }\n};\nmobileconfig.getSignedEmailConfig(options, function (err, data) {\n    console.log(err || data);\n});\n```\n\n**Profile settings generated by this example used in iOS**\n\n![](https://cldup.com/PQAEkSff1S.png)\n\n**Profile settings generated by this example used in OSX**\n\n![](https://cldup.com/UtMePZizvG.png)\n\nSee full featured example [here](examples/imap.js)\n\n## Changelog\n\n#### 1.0.3\n\n-   WiFi template\n\n#### 1.0.2\n\n-   CalDAV template\n\n#### 1.0.1\n\n-   CardDAV template and signing methods\n-   Optional callback for unsigned methods\n\n#### 1.0.0\n\n-   Initial version\n\n## License\n\nDual license **MIT or EUPL-1.1+**\n\n\u003e `mobileconfig` is part of the Zone Mail Suite (ZMS). Suite of programs and modules for an efficient, fast, and modern email server.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzone-eu%2Fmobileconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzone-eu%2Fmobileconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzone-eu%2Fmobileconfig/lists"}