Skip to content

Commit 84d9b51

Browse files
authored
Set config folder and file to permissions that are compatible with AutoPkgr
1 parent e7fc0e9 commit 84d9b51

7 files changed

Lines changed: 37 additions & 15 deletions

File tree

.github/workflows/pkgbuild.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches:
66
- main
7-
7+
88
jobs:
99
build:
1010
runs-on: macos-latest

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
build/
2-
source/
2+
src/

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [1.2.2] - 2020-09-10
4+
5+
### Fixed
6+
7+
- config.plist permissions are now retained during installation
8+
- config.plist file is no longer overwritten during subsequent installs
9+
310
## [1.2.1] - 2020-09-10
411

512
### Changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ SIMPLEMDM_API_KEY="Whvop7kWXxsva326ABDF8VDCSGFyEkuEx2xGgj4jab8AE90cn70QdBTq0fpll
3838

3939
#### Configuration File
4040

41-
You may store the key in the configuration file at `/usr/local/simplemdm/munki-plugin/config.plist`. Please scope the permissions on this file so that it is restricted, however still allowing utilities using the repo plugin to access it.
41+
You may store the key in the configuration file at `/usr/local/simplemdm/munki-plugin/config.plist`. This file is already present if you installed this plugin using the release package.
42+
43+
**Note:** Please scope the permissions on this file so that it is restricted, however still allowing utilities using the repo plugin to access it.
4244

4345
The file should be formatted as below. Be sure to provide your own API key:
4446

@@ -60,7 +62,7 @@ Any `.munki` recipe is supported. In this case, we are importing `GoogleChrome.m
6062
**Please Note:** Running MakeCatalogs.munki is not necessary. See "Using Makecatalogs" below for more information.
6163

6264
```
63-
autopkg run -v GoogleChrome.munki -k MUNKI_REPO_PLUGIN="SimpleMDMRepo" -k extract_icon=True
65+
autopkg run -v GoogleChrome.munki -k MUNKI_REPO_PLUGIN="SimpleMDMRepo" -k MUNKI_REPO="" -k extract_icon=True
6466
```
6567

6668
## Using munkiimport and manifestutil

SimpleMDMRepo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# encoding: utf-8
22

33
# SimpleMDMRepo.py
4-
# Version 1.2.1
4+
# Version 1.2.2
55

66
from __future__ import absolute_import, print_function
77

build.sh

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,32 @@ echo "::set-output name=version::${version}"
77
project_root="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
88
build_dir="$project_root/build"
99
src_dir="$project_root/src"
10+
files_dir="$src_dir/files"
1011
pkg_path="${build_dir}/simplemdm-munki-plugin-${version}.pkg"
1112

12-
rm -rf "$src_dir"
13-
mkdir "$src_dir"
13+
rm -rf $src_dir
1414

15-
mkdir -p "$src_dir/usr/local/munki/munkilib/munkirepo"
16-
cp "$project_root/SimpleMDMRepo.py" "$src_dir/usr/local/munki/munkilib/munkirepo/SimpleMDMRepo.py"
17-
mkdir -p "$src_dir/usr/local/simplemdm/munki-plugin"
18-
cp -np "$project_root/config.plist" "$src_dir/usr/local/simplemdm/munki-plugin/config.plist"
15+
mkdir -p $files_dir/usr/local/munki/munkilib/munkirepo
16+
cp $project_root/SimpleMDMRepo.py $files_dir/usr/local/munki/munkilib/munkirepo/SimpleMDMRepo.py
1917

20-
rm -rf "$build_dir"
21-
mkdir "$build_dir"
18+
mkdir -p $files_dir/usr/local/simplemdm/munki-plugin
19+
chmod 777 $files_dir/usr/local/simplemdm/munki-plugin
20+
cp $project_root/config.plist.example $files_dir/usr/local/simplemdm/munki-plugin/config.plist.example
21+
chmod 666 $files_dir/usr/local/simplemdm/munki-plugin/config.plist.example
2222

23-
pkgbuild --root "$src_dir" --identifier com.simplemdm.munki_plugin --version $version "$pkg_path"
23+
rm -rf $build_dir
24+
mkdir $build_dir
2425

25-
rm -rf "$src_dir"
26+
mkdir $src_dir/scripts
27+
echo "#!/bin/bash
28+
cp -np /usr/local/simplemdm/munki-plugin/config.plist.example /usr/local/simplemdm/munki-plugin/config.plist
29+
exit 0" > $src_dir/scripts/postinstall
30+
chmod 777 $src_dir/scripts/postinstall
31+
32+
pkgbuild --root $files_dir \
33+
--identifier com.simplemdm.munki_plugin \
34+
--version $version \
35+
--scripts $src_dir/scripts \
36+
$pkg_path
37+
38+
rm -rf $src_dir
File renamed without changes.

0 commit comments

Comments
 (0)