forked from phyzical/docker.labelInjector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker.labelInjector.plg
79 lines (68 loc) · 2.72 KB
/
docker.labelInjector.plg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?xml version="1.0" standalone="yes"?>
<!DOCTYPE PLUGIN [
<!ENTITY name "docker.labelInjector">
<!ENTITY author "phyzical">
<!ENTITY github "&author;/&name;">
<!ENTITY launch "Settings/LabelInjector">
<!ENTITY plugdir "/usr/local/emhttp/plugins/&name;">
<!ENTITY pluginURL "https://raw.githubusercontent.com/&github;/main/&name;.plg">
<!ENTITY version "2024.10.03">
<!ENTITY md5 "e57b63d25cd365c595e4e92e68e3a6a7">
]>
<PLUGIN name="&name;" author="&author;" version="&version;" launch="&launch;" pluginURL="&pluginURL;" min="6.12.3">
<CHANGES>
###2024.10.02
- Hard code options to be black text to avoid fighting dark mode
- Fix permissions in archive being set to my user instead of none
###2024.09.30
- Fix changlog
- Add support for `${CONTAINER_NAME}` in label keys also
###2024.09.02
- Adjusted how the All button works for container select
- Fix alert using , instead of nothing
###2024.08.28
- Added the ability to have quotes in labels by using ` backticks
- Added a summary of changes modal so its just a little less magical
###2024.08.26
- Added ability to add default labels via settings apge
- Added ability to use '${CONTAINER_NAME}' to be auto replaced with the container name
- Replaced select fields with choices select for better usability
- Added logic to allow editing of labels in selects
- Simplified the removal of a label to assume if its an empty label that it will be removed
###2024.07.31
- Improved form styling
- Added overview of selected containers
- Added ability to see key and value of entered labels
- Added colours for when adding or removing labels
###2024.07.29
- Initial Release
</CHANGES>
<!-- New source file -->
<FILE Name="/boot/config/plugins/&name;/&name;-&version;.txz" Run="upgradepkg --install-new">
<URL>https://raw.github.com/&github;/main/archive/&name;-&version;.txz</URL>
<MD5>&md5;</MD5>
</FILE>
<!-- Post install -->
<FILE Run="/bin/bash">
<INLINE>
mkdir -p /boot/config/plugins/&name;/styles
mkdir -p /boot/config/plugins/&name;/scripts
rm -f $(ls /boot/config/plugins/&name;/&name;*.txz | grep -v '&version;')
echo "&version;"> /boot/config/plugins/&name;/version
echo ""
echo "----------------------------------------------------"
echo " &name; has been installed."
echo " Version: &version;"
echo "----------------------------------------------------"
echo ""
</INLINE>
</FILE>
<!-- Remove the plugin -->
<FILE Run="/bin/bash" Method="remove">
<INLINE>
removepkg &name;-&version;
rm -rf &plugdir;
rm -rf /boot/config/plugins/&name;
</INLINE>
</FILE>
</PLUGIN>