Skip to content

Commit c0ece54

Browse files
committed
Move cache directories to the data folder
Every time an update is pushed the various cache folders are overwritten as well. Fix this by moving them to the data directory. The feed-icons folder is special since it is actually used to provide the icons. So instead of changing the location of it create a symbolic link.
1 parent b69f647 commit c0ece54

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.openshift/action_hooks/build

+11
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,15 @@ else
99
echo "***WARNING***: from \$OPENSHIFT_REPO_DIR/misc/config.php" | tee -a ${OPENSHIFT_PHP_LOG_DIR}/deploy.log
1010
fi
1111

12+
# Set up various cache directories
13+
if [ ! -d ${OPENSHIFT_DATA_DIR}/ttrss ]; then
14+
echo "Configuring tt-rss cache directories"| tee -a ${OPENSHIFT_PHP_LOG_DIR}/deploy.log
15+
mkdir -p ${OPENSHIFT_DATA_DIR}/ttrss
16+
cp -r ${OPENSHIFT_REPO_DIR}/php/{cache,lock} ${OPENSHIFT_DATA_DIR}/ttrss/
17+
mv ${OPENSHIFT_REPO_DIR}/php/feed-icons ${OPENSHIFT_DATA_DIR}/ttrss/
18+
else
19+
rm -rf ${OPENSHIFT_REPO_DIR}/php/feed-icons
20+
fi
21+
ln -sf ${OPENSHIFT_DATA_DIR}/ttrss/feed-icons ${OPENSHIFT_REPO_DIR}/php/feed-icons
22+
1223
cp -a ${OPENSHIFT_REPO_DIR}/misc/htaccess ${OPENSHIFT_REPO_DIR}/php/.htaccess

misc/config.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@
5656
// then most probably you are using the CGI binary. If you are unsure what to
5757
// put in here, ask your hosting provider.
5858

59-
define('LOCK_DIRECTORY', 'lock');
59+
define('LOCK_DIRECTORY', getenv(OPENSHIFT_DATA_DIR) . '/ttrss/lock');
6060
// Directory for lockfiles, must be writable to the user you run
6161
// daemon process or cronjobs under.
6262

63-
define('CACHE_DIR', 'cache');
63+
define('CACHE_DIR', getenv(OPENSHIFT_DATA_DIR) . '/ttrss/cache');
6464
// Local cache directory for RSS feed content.
6565

6666
define('ICONS_DIR', "feed-icons");

0 commit comments

Comments
 (0)