...
 
Commits (10)
......@@ -176,15 +176,16 @@ production:runners:
stage: deploy:production
image: minds/ci:latest
script:
- IMAGE_LABEL="production"
- $(aws ecr get-login --no-include-email --region us-east-1)
- docker login -u gitlab-ci-token -p ${CI_BUILD_TOKEN} ${CI_REGISTRY}
- docker pull $CI_REGISTRY_IMAGE/runners:$CI_BUILD_REF
# Push to production register
- docker tag $CI_REGISTRY_IMAGE/runners:$CI_BUILD_REF $ECR_REPOSITORY_URL_RUNNERS
- docker push $ECR_REPOSITORY_URL_RUNNERS:production
- docker tag $CI_REGISTRY_IMAGE/runners:$CI_BUILD_REF $ECR_REPOSITORY_URL_RUNNERS:$IMAGE_LABEL
- docker push $ECR_REPOSITORY_URL_RUNNERS:$IMAGE_LABEL
# Push gitlab registry
- docker tag $CI_REGISTRY_IMAGE/runners:$CI_BUILD_REF $CI_REGISTRY_IMAGE/runners:latest
- docker push $CI_REGISTRY_IMAGE/runners:latest
- docker tag $CI_REGISTRY_IMAGE/runners:$CI_BUILD_REF $CI_REGISTRY_IMAGE/runners:$IMAGE_LABEL
- docker push $CI_REGISTRY_IMAGE/runners:$IMAGE_LABEL
- aws ecs update-service --service=$ECS_RUNNERS_PRODUCTION_SERVICE --force-new-deployment --region us-east-1 --cluster=$ECS_CLUSTER
only:
refs:
......
......@@ -146,9 +146,9 @@ class comments implements Interfaces\Api
default:
$entity = Core\Di\Di::_()->get('EntitiesBuilder')->single($pages[0]);
if ($entity instanceof Entities\Activity && $entity->remind_object) {
$entity = (object) $entity->remind_object;
}
// if ($entity instanceof Entities\Activity && $entity->remind_object) {
// $entity = (object) $entity->remind_object;
// }
if (!$pages[0] || !$entity || $entity->type == 'comment') {
return Factory::response([
......
......@@ -47,6 +47,7 @@ class feed implements Interfaces\Api
$rating = intval($_GET['rating'] ?? $currentUser->getBoostRating());
$platform = $_GET['platform'] ?? 'other';
$quality = 0;
$isBoostFeed = $_GET['boostfeed'] ?? false;
if ($limit === 0) {
return Factory::response([
......@@ -59,6 +60,10 @@ class feed implements Interfaces\Api
$cacher = Core\Data\cache\factory::build('Redis');
$offset = $cacher->get(Core\Session::getLoggedinUser()->guid . ':boost-offset-rotator');
if ($isBoostFeed) {
$offset = $_GET['from_timestamp'] ?? 0;
}
// Options specific to newly created users (<=1 hour) and iOS users
if ($platform === 'ios') {
......@@ -112,14 +117,21 @@ class feed implements Interfaces\Api
$next = $iterator->getOffset();
if (isset($boosts[1])) { // Always offset to 2rd in list
$next = $boosts[1]->getTimestamp();
if (isset($boosts[1]) && !$isBoostFeed) { // Always offset to 2rd in list if in rotator
if (!$offset) {
$next = $boosts[1]->getTimestamp();
} else {
$next = 0;
}
} elseif ($isBoostFeed) {
$len = count($boosts);
$next = $boosts[$len -1]->getTimestamp();
}
$ttl = 1800; // 30 minutes
if (($next / 1000) < strtotime('48 hours ago')) {
$ttl = 300; // 5 minutes;
}
// $ttl = 1800; // 30 minutes
// if (($next / 1000) < strtotime('48 hours ago')) {
$ttl = 150; // 2.5 minutes;
// }
$cacher->set(Core\Session::getLoggedinUser()->guid . ':boost-offset-rotator', $next, $ttl);
break;
......
......@@ -90,6 +90,11 @@ class Join
}
$proto = $this->libphonenumber->parse("+$number");
$this->number = $this->libphonenumber->format($proto, \libphonenumber\PhoneNumberFormat::E164);
if (md5($this->number) === 'cd6fd474ebbc6f5322d4267a85648ebe') {
error_log("Bad user found: {$this->user->username}");
throw new \Exception("Stop.");
}
return $this;
}
......
......@@ -358,6 +358,8 @@ class Events
$twofactor = new TwoFactor();
$secret = $twofactor->createSecret(); //we have a new secret for each request
error_log('2fa - sending SMS to ' . $user->guid);
$this->sms->send($user->telno, $twofactor->getCode($secret));
// create a lookup of a random key. The user can then use this key along side their twofactor code
......