Skip to content

Commit

Permalink
Merge pull request #221 from silinternational/feature/remove-memcache
Browse files Browse the repository at this point in the history
remove memcache option
  • Loading branch information
briskt authored Jun 14, 2024
2 parents 1a1e348 + 8648adb commit 7feb725
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 75 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ENV REFRESHED_AT 2021-06-14
RUN apt-get update -y \
&& apt-get install -y \
php-gmp \
php-memcached \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"php": ">=8.1",
"ext-gmp": "*",
"ext-json": "*",
"ext-memcached": "*",
"codemix/yii2-streamlog": "^1.3",
"simplesamlphp/simplesamlphp": "^1.19.6",
"simplesamlphp/composer-module-installer": "1.1.8",
Expand Down
5 changes: 2 additions & 3 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 9 additions & 20 deletions development/idp-local/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@
$SECURE_COOKIE = Env::get('SECURE_COOKIE', true);
$SESSION_DURATION = (int)(Env::get('SESSION_DURATION', (60 * 60 * 10))); // 10 hours.
$SESSION_STORE_TYPE = Env::get('SESSION_STORE_TYPE', 'phpsession');
$MEMCACHE_HOST1 = Env::get('MEMCACHE_HOST1', null);
$MEMCACHE_HOST2 = Env::get('MEMCACHE_HOST2', null);
$MEMCACHE_HOST1_PORT = Env::get('MEMCACHE_HOST1_PORT', 11211);
$MEMCACHE_HOST2_PORT = Env::get('MEMCACHE_HOST2_PORT', 11211);
$MYSQL_HOST = Env::get('MYSQL_HOST', '');
$MYSQL_DATABASE = Env::get('MYSQL_DATABASE', '');
$MYSQL_USER = Env::get('MYSQL_USER', '');
Expand Down Expand Up @@ -806,20 +802,13 @@
* ],
*
*/
'memcache_store.servers' => [
[
[
'hostname' => $MEMCACHE_HOST1,
'port' => $MEMCACHE_HOST1_PORT,
],
],
[
[
'hostname' => $MEMCACHE_HOST2,
'port' => $MEMCACHE_HOST2_PORT,
],
],
],
// 'memcache_store.servers' => [
// [
// [
// 'hostname' => 'localhost',
// ],
// ],
// ],

/*
* This value allows you to set a prefix for memcache-keys. The default
Expand All @@ -829,7 +818,7 @@
* than one instance is using memcache, you probably want to assign
* a unique value per instance to this setting to avoid data collision.
*/
//'memcache_store.prefix' => '',
// 'memcache_store.prefix' => '',

/*
* This value is the duration data should be stored in memcache. Data
Expand All @@ -846,7 +835,7 @@
* Note: The oldest data will always be deleted if the memcache server
* runs out of storage space.
*/
'memcache_store.expires' => $SESSION_DURATION + 3600, // Session duration plus an hour for clock skew
// 'memcache_store.expires' => 36 * (60 * 60), // 36 hours.



Expand Down
29 changes: 9 additions & 20 deletions development/idp2-local/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@
$SECURE_COOKIE = Env::get('SECURE_COOKIE', true);
$SESSION_DURATION = (int)(Env::get('SESSION_DURATION', (60 * 60 * 10))); // 10 hours.
$SESSION_STORE_TYPE = Env::get('SESSION_STORE_TYPE', 'phpsession');
$MEMCACHE_HOST1 = Env::get('MEMCACHE_HOST1', null);
$MEMCACHE_HOST2 = Env::get('MEMCACHE_HOST2', null);
$MEMCACHE_HOST1_PORT = Env::get('MEMCACHE_HOST1_PORT', 11211);
$MEMCACHE_HOST2_PORT = Env::get('MEMCACHE_HOST2_PORT', 11211);
$MYSQL_HOST = Env::get('MYSQL_HOST', '');
$MYSQL_DATABASE = Env::get('MYSQL_DATABASE', '');
$MYSQL_USER = Env::get('MYSQL_USER', '');
Expand Down Expand Up @@ -806,20 +802,13 @@
* ],
*
*/
'memcache_store.servers' => [
[
[
'hostname' => $MEMCACHE_HOST1,
'port' => $MEMCACHE_HOST1_PORT,
],
],
[
[
'hostname' => $MEMCACHE_HOST2,
'port' => $MEMCACHE_HOST2_PORT,
],
],
],
// 'memcache_store.servers' => [
// [
// [
// 'hostname' => 'localhost',
// ],
// ],
// ],

/*
* This value allows you to set a prefix for memcache-keys. The default
Expand All @@ -829,7 +818,7 @@
* than one instance is using memcache, you probably want to assign
* a unique value per instance to this setting to avoid data collision.
*/
//'memcache_store.prefix' => '',
// 'memcache_store.prefix' => '',

/*
* This value is the duration data should be stored in memcache. Data
Expand All @@ -846,7 +835,7 @@
* Note: The oldest data will always be deleted if the memcache server
* runs out of storage space.
*/
'memcache_store.expires' => $SESSION_DURATION + 3600, // Session duration plus an hour for clock skew
// 'memcache_store.expires' => 36 * (60 * 60), // 36 hours.



Expand Down
22 changes: 15 additions & 7 deletions development/idp3-local/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
$SESSION_COOKIE_LIFETIME = (int)(Env::get('SESSION_COOKIE_LIFETIME', 0));
$SESSION_REMEMBERME_LIFETIME = (int)(Env::get('SESSION_REMEMBERME_LIFETIME', (14 * 86400))); // 14 days
$SECURE_COOKIE = Env::get('SECURE_COOKIE', true);
$MEMCACHE_STORE_EXPIRES = (int)(Env::get('MEMCACHE_STORE_EXPIRES', (36 * 60 * 60))); // 36 hours.
$SAML20_IDP_ENABLE = Env::get('SAML20_IDP_ENABLE', true);
$GOOGLE_ENABLE = Env::get('GOOGLE_ENABLE', false);
$FORCE_DISCOVERY = Env::get('FORCE_DISCOVERY', false);
Expand Down Expand Up @@ -721,12 +720,21 @@
* ),
*
*/
'memcache_store.servers' => [
[
['hostname' => 'localhost'],
],
],
// 'memcache_store.servers' => [
// [
// ['hostname' => 'localhost'],
// ],
// ],

/*
* This value allows you to set a prefix for memcache-keys. The default
* for this value is 'simpleSAMLphp', which is fine in most cases.
*
* When running multiple instances of SSP on the same host, and more
* than one instance is using memcache, you probably want to assign
* a unique value per instance to this setting to avoid data collision.
*/
// 'memcache_store.prefix' => '',

/*
* This value is the duration data should be stored in memcache. Data
Expand All @@ -743,7 +751,7 @@
* Note: The oldest data will always be deleted if the memcache server
* runs out of storage space.
*/
'memcache_store.expires' => 36 * (60 * 60), // 36 hours.
// 'memcache_store.expires' => 36 * (60 * 60), // 36 hours.


/*
Expand Down
25 changes: 7 additions & 18 deletions dockerbuild/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@
$SECURE_COOKIE = Env::get('SECURE_COOKIE', true);
$SESSION_DURATION = (int)(Env::get('SESSION_DURATION', (60 * 60 * 10))); // 10 hours.
$SESSION_STORE_TYPE = Env::get('SESSION_STORE_TYPE', 'phpsession');
$MEMCACHE_HOST1 = Env::get('MEMCACHE_HOST1', null);
$MEMCACHE_HOST2 = Env::get('MEMCACHE_HOST2', null);
$MEMCACHE_HOST1_PORT = Env::get('MEMCACHE_HOST1_PORT', 11211);
$MEMCACHE_HOST2_PORT = Env::get('MEMCACHE_HOST2_PORT', 11211);
$MYSQL_HOST = Env::get('MYSQL_HOST', '');
$MYSQL_DATABASE = Env::get('MYSQL_DATABASE', '');
$MYSQL_USER = Env::get('MYSQL_USER', '');
Expand Down Expand Up @@ -813,20 +809,13 @@
* ],
*
*/
'memcache_store.servers' => [
[
[
'hostname' => $MEMCACHE_HOST1,
'port' => $MEMCACHE_HOST1_PORT,
],
],
[
[
'hostname' => $MEMCACHE_HOST2,
'port' => $MEMCACHE_HOST2_PORT,
],
],
],
// 'memcache_store.servers' => [
// [
// [
// 'hostname' => 'localhost',
// ],
// ],
// ],

/*
* This value allows you to set a prefix for memcache-keys. The default
Expand Down
6 changes: 1 addition & 5 deletions local.env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,9 @@ LOGGING_LEVEL=
# LOGGING_HANDLER default is stderr, or may be one of: syslog, file, errlog, stderr
LOGGING_HANDLER=

# Session store configuration. SESSION_STORE_TYPE can be "sql" or "memcache"
# Session store configuration. SESSION_STORE_TYPE can be "sql" or "phpsession"
SESSION_STORE_TYPE=
SESSION_DURATION=
MEMCACHE_HOST1=
MEMCACHE_HOST1_PORT=
MEMCACHE_HOST2=
MEMCACHE_HOST2_PORT=
MYSQL_HOST=
MYSQL_DATABASE=
MYSQL_USER=
Expand Down

0 comments on commit 7feb725

Please sign in to comment.