File tree Expand file tree Collapse file tree 3 files changed +56
-1
lines changed
Expand file tree Collapse file tree 3 files changed +56
-1
lines changed Original file line number Diff line number Diff line change 1+ .git
2+ uim-index-dev /
Original file line number Diff line number Diff line change 1+ FROM indexyz/php
2+ LABEL maintainer="Indexyz <indexyz@protonmail.com>"
3+
4+ COPY . /var/www
5+ WORKDIR /var/www
6+
7+ RUN cp config/.config.example.php config/.config.php && \
8+ chmod -R 755 storage && \
9+ chmod -R 777 /var/www/storage/framework/smarty/compile/ && \
10+ curl -SL https://getcomposer.org/installer -o composer-setup.php && \
11+ php composer-setup.php && \
12+ php composer.phar install && \
13+ php xcat initQQWry && \
14+ php xcat initdownload && \
15+ crontab -l | { cat; echo "30 22 * * * php /var/www/xcat sendDiaryMail" ; } | crontab - && \
16+ crontab -l | { cat; echo "0 0 * * * php /var/www/xcat dailyjob" ; } | crontab - && \
17+ crontab -l | { cat; echo "*/1 * * * * php /var/www/xcat checkjob" ; } | crontab - && \
18+ crontab -l | { cat; echo "*/1 * * * * php /var/www/xcat syncnode" ; } | crontab - && \
19+ { \
20+ echo '[program:crond]' ; \
21+ echo 'command=cron -f' ; \
22+ echo 'autostart=true' ; \
23+ echo 'autorestart=true' ; \
24+ echo 'killasgroup=true' ; \
25+ echo 'stopasgroup=true' ; \
26+ } | tee /etc/supervisor/crond.conf
Original file line number Diff line number Diff line change 218218
219219#PayJs
220220$ System_Config ['payjs_mchid ' ]='' ;
221- $ System_Config ['payjs_key ' ]='' ;
221+ $ System_Config ['payjs_key ' ]='' ;
222222
223223
224224//其他面板显示设置------------------------------------------------------------------------------------------
324324$ list = explode (', ' , $ _SERVER ['HTTP_X_FORWARDED_FOR ' ]);
325325$ _SERVER ['REMOTE_ADDR ' ] = $ list [0 ];
326326}
327+
328+
329+ // make replace System_Config with env
330+ function findKeyName ($ name ) {
331+ global $ System_Config ;
332+ foreach ($ System_Config as $ configKey => $ configValue ) {
333+ if (strtoupper ($ configKey ) == $ name ) {
334+ return $ configKey ;
335+ }
336+ }
337+
338+ return NULL ;
339+ }
340+
341+ foreach (getenv () as $ envKey => $ envValue ) {
342+ global $ System_Config ;
343+ $ envUpKey = strtoupper ($ envKey );
344+ // Key starts with UIM_
345+ if (substr ($ envUpKey , 0 , 4 ) == "UIM_ " ) {
346+ // Vaild env key, set to System_Config
347+ $ configKey = substr ($ envUpKey , 4 );
348+ $ realKey = findKeyName ($ configKey );
349+ if ($ realKey != NULL ) {
350+ $ System_Config [$ realKey ] = $ envValue ;
351+ }
352+ }
353+ }
You can’t perform that action at this time.
0 commit comments