forked from dcflachs/compose_plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.manager.plg
172 lines (157 loc) · 5.07 KB
/
compose.manager.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?xml version='1.0' standalone='yes'?>
<!DOCTYPE PLUGIN [
<!ENTITY name "compose.manager">
<!ENTITY author "dcflachs">
<!ENTITY version "2022.10.15">
<!ENTITY launch "Settings/&name;">
<!ENTITY packageVER "&version;">
<!ENTITY packageMD5 "881598722716b624ce5643d5ca698e76">
<!ENTITY packageName "&name;-package-&packageVER;">
<!ENTITY packagefile "&packageName;.txz">
<!ENTITY github "dcflachs/compose_plugin">
<!ENTITY pluginURL "https://raw.githubusercontent.com/&github;/main/&name;.plg">
<!ENTITY packageURL "https://github.com/&github;/releases/download/&version;/&packagefile;">
<!ENTITY pluginLOC "/boot/config/plugins/&name;">
<!ENTITY emhttpLOC "/usr/local/emhttp/plugins/&name;">
]>
<PLUGIN name="&name;"
author="&author;"
version="&version;"
launch="&launch;"
pluginURL="&pluginURL;"
icon="cubes"
min="6.9.0"
>
<CHANGES>
###2022.10.15
- Modify the webUI integration patches to not remove old style icons.
###2022.10.11
- Fix for the update stack function.
- Add debug option in settings.
###2022.10.05
- Docker Compose v2.11.2
- Fix styling when unassigned devices plugin is not installed.
###2022.09.27
- Replace compose pull function with update stack.
- Tweak the look of the stack table.
- Add help text to settings page.
- Add label for specifying shell command.
- Add ability to patch ability to patch dockerman ui.
- Add patch to dockerman ui to fix icon caching.
- Add patch to dockerman ui to fix update ready label.
###2022.08.02
- Docker Compose v2.9.0
- Compose Switch v1.0.5
- Fix sanitizing of project names.
###2022.07.28a
- Bugfix for improperly built SweetAlert package
###2022.07.28
- Added ability to manage unRAID webui integration labels.
- Added ability to specify alternate locations to store stack files.
- Change usage for compose.yml to the standard docker-compose.yml
###2022.05.27
- Fix package build.
###2022.05.25
- Minor bugfixes.
- Include additional ace editor files.
###2022.05.21
- Minor update to fix terminal style output in 6.10.0
- Change default compose file template to not include vesion.
###2022.05.14
- Change default output style to terminal.
- Added theme support.
- Docker Compose v2.5.0
- Compose Switch v1.0.4
###2022.05.08
- Bugfix for stack names containing spaces.
###2022.03.19
- Added Ace editor from ace.c9.io
- Added button for getting compose logs. Experimental mode only for now.
###2022.03.13
- Add Icons indicating stack state.
- Disable Rename and Delete buttons when stack is running.
- Add Done button to popups in experimental mode.
###2022.02.12
- Add autostart functionality.
###2022.01.26
- Add settings page.
- Add terminal style output option.
- Add Compose Pull command.
- Add handling for .env files.
###2021.12.03
- Add basic web ui
- Docker Compose v2.1.1
- Compose Switch v1.0.3
###2021.10.03
- Initial Release
- Docker Compose v2.0.1
- Compose Switch v1.0.2
</CHANGES>
<!-- The 'pre-install' script. -->
<FILE Run="/bin/bash">
<INLINE>
# Remove old 'source' files
rm -f $(ls &pluginLOC;/&name;*.txz 2>/dev/null|grep -v '&packageVER;')
#Create projects folder if it doesnt exist
mkdir -p &pluginLOC;/projects
if [[ ! -f "&pluginLOC;/projects/version" ]]; then
#Upgrade projects to latest format
for dir in &pluginLOC;/projects/*; do
if [[ -d $dir ]]; then
if [[ -f $dir/compose.yml ]]; then
mv $dir/compose.yml $dir/docker-compose.yml
fi
fi
done
echo "1" > &pluginLOC;/projects/version
fi
</INLINE>
</FILE>
<FILE Name="&pluginLOC;/&packagefile;" Run="upgradepkg --install-new">
<URL>&packageURL;</URL>
<MD5>&packageMD5;</MD5>
</FILE>
<FILE Run="/bin/bash">
<INLINE>
patch_script=/usr/local/emhttp/plugins/compose.manager/scripts/patch_ui.sh
if [ -f "$patch_script" ]; then
#Grab the contents of our config file.
source <(grep = /boot/config/plugins/compose.manager/compose.manager.cfg)
patch_ui=${PATCH_UI:='false'}
if [ $patch_ui == 'true' ]; then
echo ""
echo "----------------------------------------------------"
echo " Applying WebUI Patches..."
echo "----------------------------------------------------"
echo ""
#Remove patchs if already applied
$patch_script -r
#Apply Patches
$patch_script
fi
fi
</INLINE>
</FILE>
<FILE Run="/bin/bash">
<INLINE>
echo ""
echo "----------------------------------------------------"
echo " &name; has been installed."
echo " Version: &version;"
echo "----------------------------------------------------"
echo ""
</INLINE>
</FILE>
<FILE Run="/bin/bash" Method="remove">
<INLINE>
#Remove patchs if already applied
patch_remove_script=/usr/local/emhttp/plugins/compose.manager/scripts/patch_ui.sh
if [ -f "$patch_remove_script" ]; then
$patch_remove_script -r
fi
removepkg &packageName;
# Remove plugin related files
rm -f $(ls &pluginLOC;/&name;*.txz 2>/dev/null|grep -v '&packageVER;')
</INLINE>
</FILE>
</PLUGIN>