Skip to content

Commit

Permalink
remove memcached
Browse files Browse the repository at this point in the history
  • Loading branch information
briskt committed Jun 13, 2024
1 parent 1a1e348 commit fa52c71
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 83 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ FROM silintl/php8:8.1

LABEL maintainer="Steve Bagwell <[email protected]>"

ENV REFRESHED_AT 2021-06-14
ENV REFRESHED_AT 2021-06-15

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
32 changes: 10 additions & 22 deletions development/idp-local/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,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 +801,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 +817,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 +834,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 Expand Up @@ -1338,7 +1326,7 @@
*
* The default datastore is 'phpsession'.
*/
'store.type' => $SESSION_STORE_TYPE,
'store.type' => 'sql',

/*
* The DSN the sql datastore should connect to.
Expand Down
32 changes: 10 additions & 22 deletions development/idp2-local/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,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 +801,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 +817,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 +834,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 Expand Up @@ -1338,7 +1326,7 @@
*
* The default datastore is 'phpsession'.
*/
'store.type' => $SESSION_STORE_TYPE,
'store.type' => 'sql',

/*
* The DSN the sql datastore should connect to.
Expand Down
24 changes: 16 additions & 8 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 @@ -647,7 +646,7 @@
*
* (This option replaces the old 'session.handler'-option.)
*/
'store.type' => 'phpsession',
'store.type' => 'sql',


/*
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
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ services:
THEME_COLOR_SCHEME: "orange-light_blue"
HUB_MODE: "true"

ssp-idp1.local: # using a database session store type ("sql")
ssp-idp1.local:
build: .
depends_on:
- db
Expand Down Expand Up @@ -181,7 +181,6 @@ services:
PROFILE_URL_FOR_TESTS: "http://pwmanager.local/module.php/core/authenticate.php?as=ssp-hub"
SECURE_COOKIE: "false"
SHOW_SAML_ERRORS: "true"
SESSION_STORE_TYPE: "sql"
MYSQL_HOST: "db"
MYSQL_DATABASE: "silauth"
MYSQL_USER: "silauth"
Expand Down
28 changes: 8 additions & 20 deletions dockerbuild/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,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 +808,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 Expand Up @@ -1348,7 +1336,7 @@
*
* The default datastore is 'phpsession'.
*/
'store.type' => $SESSION_STORE_TYPE,
'store.type' => 'sql',

/*
* The DSN the sql datastore should connect to.
Expand Down
7 changes: 1 addition & 6 deletions local.env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,8 @@ 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_TYPE=
# Session store configuration.
SESSION_DURATION=
MEMCACHE_HOST1=
MEMCACHE_HOST1_PORT=
MEMCACHE_HOST2=
MEMCACHE_HOST2_PORT=
MYSQL_HOST=
MYSQL_DATABASE=
MYSQL_USER=
Expand Down

0 comments on commit fa52c71

Please sign in to comment.