diff --git a/Dockerfile b/Dockerfile index ec614245..d53218a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,12 +2,11 @@ FROM silintl/php8:8.1 LABEL maintainer="Steve Bagwell " -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/* diff --git a/composer.json b/composer.json index da7c6d39..d40e19e6 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/development/idp-local/config/config.php b/development/idp-local/config/config.php index 3511775c..7ba190e1 100644 --- a/development/idp-local/config/config.php +++ b/development/idp-local/config/config.php @@ -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', ''); @@ -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 @@ -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 @@ -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. @@ -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. diff --git a/development/idp2-local/config/config.php b/development/idp2-local/config/config.php index 3511775c..7ba190e1 100644 --- a/development/idp2-local/config/config.php +++ b/development/idp2-local/config/config.php @@ -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', ''); @@ -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 @@ -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 @@ -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. @@ -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. diff --git a/development/idp3-local/config/config.php b/development/idp3-local/config/config.php index 6673268b..9817b072 100644 --- a/development/idp3-local/config/config.php +++ b/development/idp3-local/config/config.php @@ -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); @@ -647,7 +646,7 @@ * * (This option replaces the old 'session.handler'-option.) */ - 'store.type' => 'phpsession', + 'store.type' => 'sql', /* @@ -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 @@ -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. /* diff --git a/docker-compose.yml b/docker-compose.yml index 08e1ca6f..865c86de 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 @@ -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" diff --git a/dockerbuild/config/config.php b/dockerbuild/config/config.php index 74da5399..9355cc1c 100644 --- a/dockerbuild/config/config.php +++ b/dockerbuild/config/config.php @@ -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', ''); @@ -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 @@ -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. diff --git a/local.env.dist b/local.env.dist index fc8485c6..0c36e68b 100644 --- a/local.env.dist +++ b/local.env.dist @@ -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=