text:
image.derivatives(width,height,[background]).url() just returns the original image URL

When the results of the derivatives() function are piped into url(), we just get the original image URL instead of a URL for the cached, resized image.

This is because the .url() function/chain is still preserved for the original image, whereas .derivates().html() will return the HTML-structure. Derivatives generates the images and the srcset-attribute, which has no meaning without the HTML-tag. Therefore you'd commonly use image.derivates().html() to generate the responsive IMG-tag - including its generated images - and  image.derivates().url() to link to the fullsize image, for example as a part of a lightbox feature.

Okay, I see what you mean. But I feel like the logical thing would be for derivatives().url() to return the URL of the appropriate resized image for the user's device. Is this not possible on the server side? I thought it must be - for example, it looks like mod_pagespeed can do this even though it's running on the server side. Please correct me if I'm wrong.

derivatives().url() is unable to return the device-specific URL, because Twig renders - like PHP - server-side, ie. before any client input is returned. That, however, is not the function of the srcset-attribute. In the IMG-tag, we set a default src-attribute - typically a medium size image for fallback - and populate the srcset-attribute with alternatives. When the browser loads the site, it is already aware of the size of the viewport on render, and thus the browser will replace the src-attribute with the most appropriate image available in the srcset-attribute.
That is to say, rather than waiting on the client (browser) to report back what device is used (often through JS), we have a predefined list of available images that the browser can choose from to render to the client. It really is a question of what is more efficient: Waiting for input before selecting a source, or giving a preset menu of alternatives that are applied beforehand. In essence, srcset and derivatives does all this server-side, and waits for no input before giving the client optimized alternatives. PageSpeed does the same, but on the server-level rather than programming-interface-level.

I understand that generally server-side languages cannot get information like this about the user. But then how does mod_pagespeed do it? Does it grab the information from the request header? And could derivatives() be set up to do something similar?
I understand that derivatives() basically exists to generate a srcset HTML tag with a call to derivatives().html(). But I feel like it could be used for so much more. For example, it would be amazing if we could use derivatives().url() to get the URL of the appropriate resized image for the user's device. Could this be possible? If it worked, we would have a very cutting-edge way to do image optimization!

Mod_pagespeed and srcset deliver virtually the same thing; information is grabbed from the browser on render, determining the size of the viewport, then the browser selects the most appropriate image. Derivates() could presumably be extended to allow targeting the generated image-sizes from cache, but cache should be able to deliver the URL of it by using image.resize.url().
With mod_pagespeed or srcset you are already delivering optimized sizes for the set device-sizes, what would you want to optimize further?

To answer your question, an example of where I would use derivatives().url() would be in the CSS background-image property. It would be a super-cool cutting edge way to display optimized background images. What do you think?

You could achieve that with pseudo-CSS, ie. render it in <style> so Twig can generate it in a template.

Could you give an example of how I would code that?

This is where the derivatives()-function comes short, as it currently cannot pass paths to generated images back into Twig other than to output the full IMG-tag. That is, to my knowledge, one of the core devs might be aware of any changes to it that allows this.
Last I did this, I passed images to a macro, like this:
{% macro css(file, base, id) %}
	{% set filename = file|split('.') %}
	{% set filenameext = "." ~ filename|last %}
	{% set file = file|replace({(filenameext): ""}) %}
	#{{ id }} {
		background-image: url("{{ base }}/{{ file }}-2240{{ filenameext }}");
	}
	@media (min-width: 30em) {
		#{{ id }} {
			background-image: url("{{ base }}/{{ file }}-640{{ filenameext }}");
		}
	}
	@media (min-width: 34em) {
		#{{ id }} {
			background-image: url("{{ base }}/{{ file }}-960{{ filenameext }}");
		}
	}
	@media (min-width: 48em) {
		#{{ id }} {
			background-image: url("{{ base }}/{{ file }}-1280{{ filenameext }}");
		}
	}
	@media (min-width: 62em) {
		#{{ id }} {
			background-image: url("{{ base }}/{{ file }}-1600{{ filenameext }}");
		}
	}
	@media (min-width: 75em) {
		#{{ id }} {
			background-image: url("{{ base }}/{{ file }}-1920{{ filenameext }}");
		}
	}
	@media (min-width: 125em) {
		#{{ id }} {
			background-image: url("{{ base }}/{{ file }}-2240{{ filenameext }}");
		}
	}
{% endmacro %}

This, in conjunction with this script, to generate the responsive-sized images. Used, for example, for header images:
{{ srcset.img(page.header.header_image, page.url, "article-header-image") }}

authors: OleVik jpgklassen


text:
[add-resource] New Plugin: grav-plugin-tabs

I would like to add my new plugin to the Grav Repository.
Here are the project details: grav-plugin-tabs
The plugin provides four components:

blueprints/partials/tabs.yaml, for inclusion in a theme's blueprint
templates/partials/tabs.html.twig, for inclusion in a theme's template
js/tabs.js, enables the Tab functionality
js/tabs.css (optional), simple built-in CSS

With these, the plugin enables easy creation of tabbed content, no matter the page type (regular or modular). It is aimed mainly at theme developers, as it requires the partial template to be included in another page template to function.
There can be multiple tab sets on any given page and all tabs can retain their state (active/hidden) via URL fragments, so sharing links to a page with tabs will re-open the tabs accordingly. The plugin differs from the Shortcode UI plugin in that it only provides tabs, plus it does not do so via shortcodes.

Added to GPM for next update

source: gharchive/issue

authors: domsson rhukster

repo: getgrav/grav

license: mit

license_type: permissive

license_source: bigquery


text:
Removed dependency on arista monotime

Avoids bringing in a large dependency tree from arista/monotime

Thanks @hwh33!

source: gharchive/pull-request

repo: getlantern/mtime

license_source: github-api


text:
ArrayProperty support

Not quite sure yet as to the best approach for this. Arrays can only support one type so it may be enough to just brute convert the basics types for array props. Potentially same for TMap property support?

For the moment best way to emit arrays is to wrap them in a blueprint/c++ struct

license: MIT


text:
test/util/zip: processZipFile(): prevent filename clashes

Separating file data and meta data prevents clashes for files with names including:

filenames
toString
etc.

Motivation
Working on #1309, the return value from httpZipResponseToFiles() was confusing as it mixes both zipfile contents and zipfile metadata in the same object.  This PR aims to ease use of httpZipResponseToFiles().
PR template

What has been done to verify that this works as intended?
Ran tests.
Why is this the best possible solution? Were any other approaches considered?
This change was prompted by difficulties in understanding the results of httpZipResponseToFiles() when writing new zip-based tests.
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
Only affects developers; hopefully change is intuitive and improves understanding.
Does this change require updates to the API documentation? If so, please update docs/api.yaml as part of this PR.
No.
Before submitting this PR, please make sure you have:

[x] run make test and confirmed all checks still pass OR confirm CircleCI build passes
[x] verified that any code from external sources are properly credited in comments or that everything is internally sourced

Thank you for the extra information in the PR description, it's helpful!

authors: alxndrsn matthew-white

repo: getodk/central-backend


text:
chore: add opslevel.yml

What this PR does / why we need it
This PR adds a opslevel.yml to the root of the repository with a custom build of bootstrap to generate it. Looking for feedback on that, this will go on all libraries.
Bootstrap PR

Jira ID
[DTSS-0]

Notes for your reviewers

:tada: This PR is included in version 1.1.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:

authors: jaredallard outreach-ci

repo: getoutreach/vault-client


text:
Cannot reproduce "Wrapped types" example

In the documentation, the example under the Wrapped types is not reproducible.
Version: 0.5.0
Module: quill-async
Expected behavior
From the documentation:
SELECT u.id, u.name FROM User u WHERE (u.id = 1)

Actual behavior
Notice u.idvalue:
SELECT u.idvalue, u.name FROM User u WHERE u.id = ?

Steps to reproduce the behavior
scalaVersion := "2.11.8"
libraryDependencies += "io.getquill" %% "quill-async" % "0.5.0"

import io.getquill._
import io.getquill.sources._
import io.getquill.sources.Source._

object Test extends App {
  lazy val db = source(new SqlMirrorSourceConfig("testSource"))

  case class UserId(value: Int) extends AnyVal with WrappedValue[Int]
  case class User(id: UserId, name: String)

  val q = quote {
    (id: UserId) => for {
      u <- query[User] if u.id == id
    } yield u
  }

  db.run(q)(UserId(1))
}

@getquill/maintainers

Certainly related to #114.

Thanks 🎉

repo: getquill/quill


text:
pass ssl settings to async driver

Fixes #586
Problem
It's impossible to use the async driver with postgresql or mysql that require secure connection
Solution
Pass ssl properties to async conext config
Notes
I am not sure how can this change be unit tested
Checklist

[x] Unit test all changes
[x] Update README.md if applicable
[x] Add [WIP] to the pull request title if it's work in progress
[x] Squash commits that aren't meaningful changes
[x] Run sbt scalariformFormat test:scalariformFormat to make sure that the source files are formatted

@getquill/maintainers

sure, done

@liorhar It seems that there are source files unformatted. Also, could you please rebase your branch? Github doesn't allow me to do it.

sure. done

thanks @liorhar!

authors: fwbrasil liorhar


text:
Body always empty?

Hi,
it looks like that in our setup raven is not capturing any http body in the context of the logged exception, while other things like cookies, headers and environment variables are there.
Any suggestions on how to debug this issue?

It looks like we don't attempt to extract the body in HttpInterface.
In my understanding: one issue with ServletRequest is that the request body can only be read once, and presumably it has been read by you or your framework before an exception is thrown over to Raven. We do have RavenServletRequestListener, but it doesn't seem like we have a chance to wrap the request in something to cache the response there.
Would love anyone else's thoughts on this. I'll see what else I can come up with.

Correct, we already have a listener to cache the body stream for logging purposes, maybe there is some way via Raven Java API to set such body so I can have it on my exceptions?

Since you have the data available from your listener you should be able to make it work. Sadly it seems like it might be kind of annoying,
We attach the HttpInterface and HttpInterfaceBinding here: https://github.com/getsentry/raven-java/blob/master/raven/src/main/java/com/getsentry/raven/DefaultRavenFactory.java#L228-L231
I think you'd need your own RavenFactory and your own HttpInterface and HttpInterfaceBinding in the current implementation. :( This is because interfaceBindings are not run in a specified order (this is intentional) and so if you just added your own simple interface it may be overwritten by the existing HTTP binding.
I wonder what a more general solution could be...

To be clear, I'd love your input here. I wonder if many users keep a cached copy of the body around because it can only be read once. Maybe some easy way for those users to hand off the body to us...?
It'd be great to solve this for everyone, even those without the cached body. I don't know what we can do given the interface though.

Did you have any luck with this @gionn ?

Yeah, I've ended up using slf4j MDC facility to set some context tags, one of them contains the body of the request that generated an exception.

authors: bretthoerner gionn

repo: getsentry/raven-java


text:
Unable to extract source maps from dependencies when native exception occurs

Platform
Flutter Web
Obfuscation
Enabled
Debug Info
Enabled
Doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.3, on macOS 14.1.1 23B81 darwin-x64, locale en-FR)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.94.0)
[✓] Connected device (2 available)
[✓] Network resources
• No issues found!
Version
8.9.0
Steps to Reproduce
I don't have a clue on how to reproduce since I cannot identify the error at all

Expected Result
I should be able to see the source code for my own code at least. You can see in the stacktrace that there are some part that matches my flutter application.
It's only this specific issue that causing troubles, other issues are showing stacktraces correctly
Actual Result
I can't see anything aside from the exception message

Are you willing to submit a PR?
None

hey can you provide more info on your setup, which packages do you use? is this somehow related to wasm? I'm confused why there's native code in a flutter web app

I've tweaked my index.html to include a loader as you can see below
The app can be used in kiosk mode so behaviour changes depending on whether or not we're on an android device, for that I rely on kIsWeb and Platform.isAndroid
Aside from that, the rest is very standard
<!DOCTYPE html>

  <base href="$FLUTTER_BASE_HREF">

  <meta charset="UTF-8">
  <meta content="IE=Edge" http-equiv="X-UA-Compatible">
  <meta name="description" content="Medami est un questionnaire de santé intelligent pour rendre acteurs de votre santé et vous offrir une meilleure prise en charge par votre praticien.">

  <meta name="mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-title" content="medami_patient">
  <link rel="apple-touch-icon" href="icons/Icon-192.png">

  <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
  <link rel="icon" href="favicon.ico" type="image/x-icon">

  <title>Medami - Votre questionnaire de santé intelligent</title>
  <link rel="manifest" href="manifest.json">

  <link rel="stylesheet" href="loader.css" />

do you mind sending over the event to my email giancarlo.buenaflor@sentry.io
from what I can tell though this is issue starts in the SDK, unparsed usually means we could not parse a stacktrace on the SDK level. It could be in a format that we do not expect for example so we don't handle it. from the looks of it the unparsed frame most likely comes from IDBDatabase.
The exception comes from here.

Hi @buenaflor I've shared an even by email, I did not have time to dig that up since and I've mitigate all issues I had so I don't have any new event.
However, it seems like very last similar issues I had have a correct stacktrace, still a few missing sources but at least, it's readdable

Reproducing the issue is quite tricky but here you go :

Set up a flutter web app
Set up an express server
Set up HTTP 1.1 protocol on the server (defaults should do it)
Requests every 5 seconds in the flutter app
Some requests should randomly failed
Analyze packets with tcpdump + wireshark
You should see that the server returned FIN+ACK after 5 seconds of inactivity while the flutter app sent on the same TCP stream a new request to reuse the keep-alive
If that's the case, you should see the error I had in Sentry because http client was raising an unexpected closed socket error

My setup was more complex involving AWS Api Gateway + AWS Service discovery + AWS ECS, however, the race condition in HTTP 1.1 is something you can find around on the internet

@Masadow Thanks for the detailed reply and the reproduction steps!
We are going to have another look into it

authors: Masadow buenaflor stefanosiano

repo: getsentry/sentry-dart


text:
Double entry with different level - only from view

I just updated Sentry from 0.10 to 1.0 on my Laravel project, which still is on version 5.7.
However, sometimes it is acting weird and put double entries into Sentry. Here is example:
HomeController:
public function index()
{
    throw new \Exception("Error Processing Request", 1);
}

When I visit homepage, it send my exception into Sentry and shows only once with level Error.
Error level: Error - Exception
in \app\Http\Controllers\HomeController.php
Error Processing Request
If I put there something like this and visit homepage not logged in
public function index()
{
    $a = \Auth::user()->tst;
}

It produce two errors into Sentry, both with level Info.
Error level: Info - ErrorException
in \app\Http\Controllers\HomeController.php
Trying to get property of non-object

When I have my view like below and visit any page not being logged in, it log twice with different levels
layout.blade.php:
var a = @json(Auth::user()->tst)

Error level: Info - ErrorException
in \storage\framework\views\37f5806917ac9107d4ad865b4c5dfb9772471201.php
Notice: Trying to get property of non-object
Error level: Fatal - ErrorException
in \storage\framework\views\37f5806917ac9107d4ad865b4c5dfb9772471201.php
Trying to get property of non-object (View: D:\www\SunPrihlasky\resources\views\layouts\app.blade.php)
It is good to mention, that in my Laravel log folder are all those errors logged just once and always with level Error.
Is there something what I'm missing? I deleted all code to set up more data like user, tags etc and it does still the same. I tried to checkout older commit, downgrade packages back to 0.10 and it was logging errors from view only once. When I checkout back to master and upgraded to 1.0 it does this weird behaviour again.

Just discovered. If I do not "Add Sentry reporting to App/Exceptions/Handler.php:" nor use "Laravel 5.6 log channels", it shouldn't be logging anything. But it does and then it occurs in Sentry just once.

@arxeiss there could be a few thing at play here.
First to make sure we are talking about the same thing, calling $object->property_that_does_not_exist creates a PHP Notice (or error of level notice). This is different from an Exception which can be caught, notices are not capturable (only suppressible by using the @ operator).
So what happens when a notice is thrown, it will be caught by the error_handler once by Laravel and once by Sentry. Sentry sends errors directly to sentry.io if it's within the configured error level (which by default it is). Laravel will log this notice to a log file (or channel).
So if you are using both a log channel and Sentry a notice will be duplicated because Sentry / Laravel don't know if either handled the error (notice).
Important to keep in mind that the snippet you add to the Laravel exception handler class only captures Exceptions (so no errors and therefore notices).
If you want to truly disable Sentry sending errors keep the DSN set to null.
Does the above answer your questions?

Thank you for detailed answer. Yes I know, that E_NOTICE is not an exception. But yes, Laravel convert it into Exception. And this is the problem.
Because sometimes I have code like this
try{
    ...
}catch(SomeException $e){
    \Illuminate\Support\Facades\Log::warning($e);
}

And I have default channel stack with daily and sentry. So if this SomeExceptions happen, then I have info in my local file and Sentry as well.
But because of this, also Exception created from E_NOTICE is logged into stack. So those error will occur in Sentry twice.
So is there some way, how to disable Sentry to register error_handler, because Laravel will do too? Otherwise I don't know how to deal with this. To be able use \Illuminate\Support\Facades\Log to log into local file and Sentry, but do not log E_NOTICE etc into Sentry twice.
Thank you

Ah I think I misunderstood what you wanted to achieve there. Sorry about that.
Disabling the error handler is actually pretty doable by adding the following to config/sentry.php:
   'error_types' => E_ALL ^ E_NOTICE, // Add what you want to ignore or set it to `0` to disable error reporting at all.

Sorry, I really explained it badly, as I thought the origin of this issue is totally different. Now I updated config and it works! Thank you
Now I found it is also in documentation, but before I wasn't able. Don't understand it
Thank you for your patient.

No problem, happy you got it resolved. Thanks for the update!

Just to clear this up.
I set config to 'error_types' => E_ERROR, set memory_limit to 10M and loads much more data. Sentry SDK and Laravel logged issue into Sentry. Then I tried the same with max_execution_time and also everything appear twice. When I set 'error_types' => 0 then it was there just once.
So you can disable it totally (not deeply tested).
And I think you have mistake in documentation (when I finally found the option): https://docs.sentry.io/platforms/php/default-integrations/#errorlistenerintegration
You write you reserve 10 MB, but you actually do just 10kB.

authors: arxeiss stayallive

repo: getsentry/sentry-laravel


text:
report() may set wrong handled property

    Thanks! Can confirm the patch fixed it.

All exceptions are now reported as unhandled. Even the ones manually logged through Laravel's report() helper – which I use to 'soft'-report exceptions that didn't crash the application. How did you intend to make a distinction between handled and unhandled exceptions? Laravel doesn't have a concept of handled vs. unhandled exceptions.
Originally posted by @devfrey in https://github.com/getsentry/sentry-laravel/issues/608#issuecomment-1313632113

Our goal was to introduce a distinction between errors sent via captureException() handled: true and errors caught by the global error handler of the framework handled: false.
https://laravel.com/docs/9.x/errors#the-report-helper
public function isValid($value)
{
    try {
        // Validate the value...
    } catch (Throwable $e) {
        \Sentry\captureException($e); // handled: true

        return false;
    }
}

It's a bit unfortunate that report() behaves that way. So we may have to make a decision on how to handle this going forward.
Having handled: false is highly valuable, as it highlights the errors with higher priority IMO.


text:
ref(profiling): Deprecate hub in Profile

Related to #3265

@sl0thentr0py none of our code accesses the hub attribute, as far as I can tell.

the working of the profiler is internal to the SDK

Where do we defined that this Profile is for internal use only? Neither the module, class, nor the attribute are underscored, so I assumed that this attribute was public API, and therefore it would be a breaking change to simply remove the attribute, since a user's code might access it (not sure why, but hypothetically this could be the case).
If it is truly internal only, I would be fine with simply removing the hub attribute and/or (if it is also internal only) the hub parameter from the constructor. But if it is not, then we cannot just remove these and we need a deprecation warning.

right ok, I don't think we wanted anyone to use the Profile but that's fine then

@sl0thentr0py, I think generally something we could do better in the SDK would be to limit our public API surface and maybe more clearly define what we actually consider to be public API. For instance, perhaps we could decide that everything that we don't explicitly re-export via __all__ is considered an SDK implementation detail, or we can just get better about adding underscores to things that don't need to be public. Probably this is something that needs to wait for a major, but it would certainly make maintaining the SDK a lot easier if we had a smaller public API surface and therefore did not need to introduce quite as much backwards-compatibility code

repo: getsentry/sentry-python


text:
Improve logging for background jobs season

Rabbit season

Flaky Test
Failure Summary
Logs

[chromium] should display user profile information correctly.
The test timed out waiting for the expected text "User Profile" in the page, but it received an empty array instead.
Logs ↗

[chromium] should return list of users correctly.
The API call to get a list of users failed with a 404 Not Found error.
Logs ↗

[chromium] should load the pricing page correctly.
The pricing page failed to load correctly, and the title and heading were not found within the expected time.
Logs ↗

[chromium] should display error message for invalid login correctly.
The expected HTTP status code 401 was not received, instead a function was returned.
Logs ↗

... and 1 more

View Full Report ↗ ⋅ Docs


text:
Automatic mirage frequency based on fan RPM

I added a function to make mirage effect usable across all fan rpms - it sets the frequencies according to fan RPM multiplied by a factor (user settable). Works on my machine.
Please test
Fan sensor can be chose similar to temperature sensor.

Uses the same smoothing factor to smooth out fan sensor errors, which is also used for frequency smoothing. To make the code more uniform for all 3 sensors, smoothing also used for temperature, where it should not have a great effect. (as suggested in issue https://github.com/gfduszynski/cm-rgb/issues/34)

Fixed my variable names to your naming style.

Contains the parts separating windows/linux, because I already added that and did not want to remove for PR - should not matter much. Thus raises NotImplemented if Windows and Temperature activated.

Oh wow, impressive :1st_place_medal:
I'll try this tomorrow after work.

This is great!
When running on windows, line "c.disableMirage()" causes the script to fail. Commenting it out allows the script to run.
The error is: "AttributeError: 'CMRGBController' object has no attribute 'disableMirage'"

Do you have the latest version of cm-rgb from pipy installed?
Otherwise this is the reason this function does not exist.

Also the mirage effect is also missing a function to read fan rpm on windows - if you have a similar solution to getting the temperature on windows that'd be awesome

Let me try to use the pypi version vs pulling git.
I'll work on the RPM solution and let you know when it's working! Should be
pretty straightforward.
On Wed, 3 Jun 2020 at 18:07, mpsdskd notifications@github.com wrote:

Also the mirage effect is also missing a function to read fan rpm on
windows - if you have a similar solution to getting the temperature on
windows that'd be awesome
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/gfduszynski/cm-rgb/pull/36#issuecomment-638296083,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AB47W4ZVVIYGYIYXSOCCXVDRUZYMRANCNFSM4NQASGTQ
.

I have a day off on 11.06 so I'll merge this then regardless of windows support.
This is too cool to wait :)

authors: gfduszynski mpsdskd vexersa

repo: gfduszynski/cm-rgb


text:
[example][hal-quad] Destroy shader modules immediately after creating PSO

Actually, it's not an important PR, just for clarification that PSOs copy shader code from ShaderModules instead of borrowing.
It's OK to close it without merging ;)

Not sure about this one, I prefer the old one because I think it's easier to follow the code when clearly separated into construction and destruction parts.
Would appreciate other opinions on this.

I'm slightly more in favor of this PR. Would appreciate more opinions :)

We could move shader module creation and destruction completely into the pipeline creation block. This would be a bit cleaner imo, also easier to reason about the lifetime of the shader modules.

@davll would you want to finish the PR according to the last recommendation?

authors: davll kvark msiglreith

repo: gfx-rs/gfx


text:
Fix clearing of GL depth buffer

Fixes #3202
It seems that the same issue could apply to the stencil and color buffers too (they have their own stencil_mask and color_mask functions which are not reset), but it would take some time for me to test that.
PR checklist:

[ ] make succeeds (on *nix)
[ ] make reftests succeeds
[x] tested examples with the following backends: gl
[x] rustfmt run on changed code

Wow this bot spams, could just notify about forgotten cargo fmt.
Sorry for another rewrite, but to fix the requested non-queued push_cmd I had to refactor push_cmd itself. I separated buffer storage into a separate struct so push_cmd does not need to borrow entire CommandBuffer. This also removes the ugly push_cmd_internal used to avoid borrow errors. If this is too much I can just revert to queueing commands into temporary vec.

Had a hiccup with squash but should be ok now

bors r-
actually, Travis looks really sad

My bad, some errors appeard due to merge with master. Travis succeeded now.

authors: chemicstry kvark


text:
Is there a way to set the wild char when type in pattern?

Sometimes when I meet the pattern "j=" "k+" "k_" which is hard to
press the second char. So is there a way to set a wild char to match any char?
For example I press "j*" can match any two char pattern start with j

You can use equivalence_classes (mutual aliases), but wildcard characters like in your suggestion are impossible if you want ahead-of-time displayed labels. Think about it: when targeting k+, after pressing k, the plugin cannot know whether you will type + or * (the wildcard character), so it cannot decide which label to show (the labels are different in the two cases, since the wildcard would match a lot more targets).

authors: ggandor woshichuanqilz


text:
does this conflict with indent-blankline.nvim?

hi dumb question, but will this conflict with my current setup?

current config
return {
  {
    "lukas-reineke/indent-blankline.nvim",
    main = "ibl",
    event = { "LazyFile" },
    lazy = true,
    dependencies = {
      { "shellRaining/hlchunk.nvim", lazy = true },
      {
        "https://gitlab.com/HiPhish/rainbow-delimiters.nvim",
        name = "rainbow-delimiters.nvim",
        url = "https://gitlab.com/HiPhish/rainbow-delimiters.nvim",
        event = "VeryLazy",
        lazy = true,
      },
    },
    config = function()
      local ibl_status_ok, ibl = pcall(require, "ibl")
      if not ibl_status_ok then
        print("ibl not found!")
      end
      local hooks = require("ibl.hooks")
      local hlchunk_status_ok, hlchunk = pcall(require, "hlchunk")
      if not hlchunk_status_ok then
        print("hlchunk not found!")
      end

      local highlight = {
        "RainbowRed",
        "RainbowYellow",
        "RainbowBlue",
        "RainbowOrange",
        "RainbowGreen",
        "RainbowViolet",
        "RainbowCyan",
      }
      hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
        vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
        vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
        vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
        vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
        vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
        vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
        vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
      end)
      hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)

      ibl.setup({
        indent = {
          highlight = highlight,
          char = "│", -- "▎"
        },
        scope = {
          enabled = false,
        },
        exclude = {
          filetypes = {
            "lspinfo",
            "packer",
            "checkhealth",
            "help",
            "man",
            "gitcommit",
            "TelescopePrompt",
            "TelescopeResults",
            "aerial",
            "dashboard",
            "fidget",
            "NvimTree",
            "cmp",
            "cmp_docs",
          },
          buftypes = {
            "terminal",
            "nofile",
            "quickfix",
            "prompt",
          },
        },
      })

      hlchunk.setup({
        chunk = {
          enable = true,
          priority = 15,
          notify = true,
          style = {
            "#5ef33e",
            "#c21f30",
          },
          chars = {
            horizontal_line = "─",
            vertical_line = "│",
            left_top = "╭",
            left_bottom = "╰",
            right_arrow = "",
          },
          textobject = "ic",
          duration = 250,
          error_sign = true,
          exclude_filetypes = {
            aerial = true,
            dashboard = true,
            fidget = true,
            NvimTree = true,
            TelescopePrompt = true,
            cmp = true,
            cmp_docs = true,
          },
        },
        line_num = {
          enable = true,
          style = "#C678DD",
          use_treesitter = true,
          exclude_filetypes = {
            aerial = true,
            dashboard = true,
            fidget = true,
            NvimTree = true,
            TelescopePrompt = true,
            cmp = true,
            cmp_docs = true,
          },
        },
        blank = { enable = false },
      })

      local rainbow_delimiters_status_ok, rainbow_delimiters = pcall(require, "rainbow-delimiters")
      if not rainbow_delimiters_status_ok then
        print("rainbow-delimiters not found!")
      end
      vim.g.rainbow_delimiters = {
        strategy = {
          [""] = rainbow_delimiters.strategy["global"],
          vim = rainbow_delimiters.strategy["local"],
          commonlisp = rainbow_delimiters.strategy["local"],
          html = rainbow_delimiters.strategy["local"],
          latex = function(bufnr)
            local line_count = vim.api.nvim_buf_line_count(bufnr)
            if line_count > 10000 then
              return nil
            elseif line_count > 1000 then
              return rainbow_delimiters.strategy["global"]
            end
            return rainbow_delimiters.strategy["local"]
          end,
        },
        query = {
          [""] = "rainbow-delimiters",
          lua = "rainbow-blocks",
          latex = "rainbow-blocks",
          query = function(bufnr)
            local is_nofile = vim.bo[bufnr].buftype == "nofile"
            return is_nofile and "rainbow-blocks" or "rainbow-delimiters"
          end,
        },
        priority = {
          [""] = 110,
          lua = 210,
        },
        highlight = highlight,
      }
    end,
  },
}

or else, if you can, you can also propose a PR to have a function in indent-blankline itself because most likely people will try to opt this out in favour of indent-blankline.nvim

hi dumb question, but will this conflict with my current setup?

Yes, it will.

you can also propose a PR to have a function in indent-blankline itself

indent-blankline.nvim is just for indentation, fold_line.nvim is for folding, you could simulate the former by :set foldmethod=indent.

indent-blankline.nvim is just for indentation, fold_line.nvim is for folding, you could simulate the former by :set foldmethod=indent.

so do i have to leave indent-blankline?

so do i have to leave indent-blankline?

No, you don't have to. There are people who don't use indent-blankline.nvim like me. If you care more about indentation than folding, use indent-blankline.nvim, otherwise, you could try fold_line.nvim.

so do i have to leave indent-blankline?

No, you don't have to. There are people who don't use indent-blankline.nvim like me. If you care more about indentation than folding, use indent-blankline.nvim, otherwise, you could try fold_line.nvim.

i see, thanks

authors: daUnknownCoder gh-liu


text:
New feature discussion: TLS

I have decided to implement TLS (wss://) in the server using the built-in PHP OpenSSL functions.
This will require much testing and much review.  I know I'm good, but I also know that hubris is the cause of many security holes.  Simply put, I simply refuse to trust myself when it comes to encryption, even if I know I'm doing everything right.  (I've had good teachers when it comes to encryption.  I don't trust them, either.)
So, this be the discussion thread for implementing TLS.

One thing I'm personally big on is encrypting your private key with a passphrase.  I think the WS server should be able to load an encrypted private key when it's staring up and prompt the operator for a passphrase.
This would require human intervention in case the server ever needs to be restarted, such as after a power loss to the hardware...  Security comes at the cost of convenience.  If anyone is not comfortable getting up at 2am to SSH into their machine and enter a password, then they shouldn't encrypt their private key... then again, they also run a greater risk of their private key being compromised in case their server is compromised.

Anyone intending on working on TLS once I get the initial branch set up: Check the OWASP TLS cheat sheet often.
https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet

Both Chrome 43 and Firefox 38 do handshakes for TLS 1.0.
Vulnerabilities of TLS 1.0 are CBC Chaining and Padding Oracle attacks.
TODO: Find out if we can mitigate these attacks in WS.
Anyways, looks like we're implementing TLS 1.0 first, then can work up to 1.1 and 1.2.  I wonder if we can get browsers to update their TLS defaults for wss: connections to reflect their https: defaults.

anything new on this? trying to implement https/wss using your library, which btw works great for what i'm using it for!!!
is there anything i can do to implement wws, i'm still new to the websocket but now have a fully working solution on our intranet using your library and exploring future https implementation and big stop on using chrome because the websocket is not using wss while https.
Thanks!!

Currently blocked on other changes.
The end goal of those changes are to make TLS work properly and securely, and make the server easier to use and extend (and a bit faster and more reliable).
Progress is slow, but not completely stopped.

Anything you can point me toward to help?
Using this on a custom trouble ticket system I built to provide real-time updates and other features, haven't had a single issue so far
Thanks!

Hi tylorjefcoat,
I have just got my WSS working. You can use this as an example,
however do not copy this directly into Ghedypunks class as I have changed
naming conventions etc to suit my own needs.
ssl websocket example.txt

Hi, any news on the "wss" thing? I use your great code for the client-server communication of a home automation (mostly blinds) system. And I really would be happy to be able to use secure communication. Thanks!

Been busy with young kids and a new job.
I will make TLS support a priority over the next few weekends.

I guess the easiest way is to switch from socket library to stream library and use the built-in tls protocol.

@ghedipunk: Thanks for your efforts. I appreciate that :-)
@Xaraknid: With PHP, streams seems to be easy. How would the interface in Javascript on the client side look like? Or better, do you know of an simple example? E.g. a chat tool?

That's what I was just thinking, as well.
I'm really torn on whether to do it in the new development branch first, or in the legacy branch, though.  I don't have nearly enough done in the new development branch that I could take it to completion quickly.  (At least, not quickly while I've got 1 year old twins in my house.)  On the other hand, the new branch is meant to make unit testing easy, which is a feature that I think is almost as important as TLS.
Alright, decision made: I am officially putting unit testing on the ledger as technical debt.  Any new development done without getting a good baseline for unit testing will add to that technical debt.  And, I am officially adding more technical debt by deciding to implement TLS on the legacy branch first.
The Javascript and all other client code would stay exactly the same, we'd just be able to use "wss://" properly now.  (If the client code doesn't support TLS, then it would have to be updated, but all major browsers use TLS 1.0 when opening a connection with the WSS protocol.)

Client side should be easily done by changing ws:// to wss:// the browser take control of TLS transaction and encrypt/decrypt the wire.
The code stay the same either you use ws or wss the only thing change is that you add a layer on the wire.

Current way that the server is implemented, we can't have both a secure and insecure connection going at the same time without changing the constructor's signature.  (I consider that a soft breaking change: Easy solution is to add more parameters to the constructor, but we can't change the order of arguments without breaking backwards compatibility.)
I'm of the opinion that if a process is handling secure data, it shouldn't handle data insecurely...  That is, if you're using TLS, then all traffic must be over TLS.  However, this opinion isn't shared with people who are used to the Apache HTTPd way of doing things, where the same process will happily serve up HTTP and HTTPS content at will.
So, either use WS or WSS.
Not sure how the major browsers handle self-signed certs over WSS...  Will need to test.
Will also need to set up the cert on my public web server.
See also: https://www.eff.org/press/releases/new-free-certificate-authority-dramatically-increase-encrypted-internet-traffic

Note: Latest push to the legacy branch (d1cfae2bbe1c0f922c2ad18ee57951e77aaf99a0) is broken.
Will not make an attempt to unbreak it until I'm ready to see if the changes work or not.

You are right you can't run both at the same time.  But I think you can support both all will depend how you start the server.
ws
$test = new phpws("0.0.0.0","8080",'stream');
wss
$test = new phpws("tls://0.0.0.0","8080",'stream');
for stream the job is done internally only thing required is to config it
$ctx=stream_context_create(array('ssl'=>array(
"local_cert"=>"mycertandkey.pem",
"passphrase"=>"badpassphrase"
)));
Not tested it yet and as said socket and libev all job need to be done by server. By knowing the layer those job need to be done you only need to have a flag turn on when using TLS connection and call private method when the flag is on (encrypt / decrypt).
Self-signed certificate will at least pop-up a warning if not working at all. Let's encrypt is a good solution.

Well on the way to switching to a stream_socket_* based implementation, rather than the socket_ wrappers around the C BSD Sockets library.
Potential Compatibility Note: Moving the Master socket resource out of the sockets array.  (You only need to worry about this if you implement your own run() method, or otherwise expect the Master socket resource anywhere but $this->master.)
New implementation will use stream_socket_accept() with a zero timeout before the one second blocking on stream_socket_select(), rather than having the master socket (now the master socket stream) be included in &$read and again tested against $this->master.

There is minimal difference between stream and socket. I can assure you as I can run both eventloop.
Master socket MUST be in socket array know as $read. socket_select or stream_socket_select.  Otherwise the server will never be notify that a client attempt to connect.
I highly against a timeout of 0 that will result in heavy wasted CPU usage.  It's better to wait patiently untill there is something on the wire than checking constantly with nothing on the wire.

Legacy branch passes very basic smoke test after switching to stream_socket_* implementation.  (Smoke test on PHP 5.5, OSX)
Have not yet tested the TLS part, don't have any certs handy on this machine.

Great point about the timeout of zero.  Matches my observation of the high-CPU busy loop, although stream_socket_accept did work when I tried accepting.  Once stream_socket_select had a socket in &$read to check, it respected the 1 second timeout there.

The only good reason I see to use timeout is if you want to implement disconnection process after too long inactivity like sending a ping opcode and if no pong then kill the client.  Even there I prefer having timeout blank.
An advice do not use @ they are tempting but you should restraint yourself of using it. First they are slow, secondly and the most important point is that you only hide bug under the carpet.  It's better to found and kill the bug on the long run.

Moved the master resource back into the &$read parameter of select(), along with accept().  (Switched things up to break out of the foreach, rather than have an if/elseif/else.)
Passes smoke test.
Besides worrying about TLS, I also want to test unusual client disconnects, since I couldn't find the appropriate functions to check TCP error codes under the stream_ functions in the manual.  (Note to self: Also verify normal client disconnects.)

Note on testing timeline:  The host that manages the server to which ghedipunk.net is pointed has recently changed details about their SSH access on their managed VPS accounts... Basically, they said that it's hard to support people who know what they're doing, so they're taking away our tools, and those who want the tools back will have to pay 10 times what they're paying now for a dedicated server.  No SSH to the terminal.  No sudo.  Just a few point-and-click options on a recently dumbed down admin panel. (alright, I'll stop ranting. Yes, I used to recommend them. Now I don't.)
So, since I'm too lazy to actually switch hosts, and I really don't want to bother spinning up a new host on Amazon's cloud, I'll be setting things up on the linux box at my house and in order to get a certificate through Let's Encrypt, I'll be making a few domain changes, which will take some time to propagate...
In other words, I might not get to testing the actual TLS portion tonight.  Will absolutely test the client disconnect scenarios, though.

Progress so far:
Basic smoke test passed on Windows 10, PHP 5.6.
Found an old(ish) cert (still valid for a couple more months) and edited my hosts file to make localhost match.
So far, failing at "stream_socket_accept(): Failed to enable crypto" which is good progress.  Probably need to create an openssl.cnf file.

Warning: stream_socket_accept(): SSL operation failed with code 1. OpenSSL Error messages:
error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number

Definite progress.  It's handshaking.  Not really in the mood to get OpenSSL working on Windows, though.
Time to move it over to Linux.

Correction: Great success!

(Note: ghedipunk.net is pointing to localhost in this case, due to edits in my hosts file)
Trick was to edit client.html on disk, rather than use Chrome's DOM editor to change the URI scheme from WS to WSS after it was loaded.
Will polish things up then push things so far, then get on to testing the differences between Berkeley sockets and Stream sockets.

3c2d6ca402c827d4ddcc750a98159f6d74b35b5c passes the smoke test.
Some cleanup needed...  I'm thinking of having an example TLS echo server, just like the current testwebsock.php, and probably update client.html with the option to connect with either WS or WSS.
Will also need to update the readme.
Then I need to really dig into the differences between Berkeley sockets and stream sockets, especially detecting when a client disconnects, whether normally or abnormally... then test large packets, Nagle's Algorithm... Then I'll add the Autobahn|testsuite to the standard testing procedures...  THEN merge into master.
Then back to work on the next branch.  (Actually, work on the support site first, but that's a whole other mess.)

Sounds great :-) I'd use - once it's stable - the PHP part on a Raspberry Pi 2 and the Client on Windows 7 and iOS 9.x. Thanks for your work!

http://phpsecurity.readthedocs.org/en/latest/Transport-Layer-Security-(HTTPS-SSL-and-TLS).html
A very good information about secure connection.  It's important to fine tune configure options around ssl/tls connection to prevent many sort of exploit and in the end having false impression of "security".
I know you want to keep backward compatibility and I think a good way to do that for adding TLS feature without having user the need to go in internal file ( websockets.php ) to config it. In the path right now every patch to the core will required the user to modify it to set up the feature.
I suggest moving this step outside of websockets.php to testwebsock.php.  Simply change the construct from
__construct($addr, $port, $bufferLength = 2048)

to
__construct($addr, $port, $type= 'ws',$bufferLength = 2048,$ssl_options='')
or similar order

That will be backward compatible, need of only one method to setup connection.
With that you can check enforce all options neccessary for secure connection to be present if some missing exit("malformed ssl_options missing X ")

The route that I've already started going down is removing the setupSecureConnection() method, and will have the example script (testtlssock.php) override setupConnection() with a secure implementation.
So far,
class echoServer extends WebSocketServer {

    /**
     * Overrides the base setupConnection to implement TLS.
     *
     * @return void
     */
    protected function setupConnection() {
        $errno = $errstr = null;

        $options = array(
            'ssl' => array(
                'peer_name' => 'YOUR DOMAIN NAME HERE',
                'verify_peer' => false,
                'local_cert' => 'cert.pem',
                'local_pk' => 'pk.key',
            ),
        );
        $context = stream_context_create($options);

        $this->master = stream_socket_server(
            'tls://' . $this->listenAddress . ':' . $this->listenPort,
            $errno,
            $errstr,
            STREAM_SERVER_BIND | STREAM_SERVER_LISTEN,
            $context
        );
    }
... continue on with the echo server as in testwebsock.php

I need to research some secure defaults for the context options still, before I put the example up publicly.  My philosophy is that security requires failing closed, so I'm also considering putting in how to encrypt and decrypt the certificate, securing the context options inside of a configuration file (which is really where these details need to live, so that nobody is editing source code to change, say, the filename for the cert), and even encrypting the config file and prompting for a password to decrypt that option file when the WS server starts up.

By prompting for password didn't prevent the use of nohup and let's only option screen ?

Yes, prompting for a password will prevent the use of nohup, which will require the process itself to become a daemon.
Process to become a daemon:

Fork, close original process.
Become session leader. (Allows children of this process to be explicitly inherited by init once this process goes away)
Close STDIN, STDOUT, STDERR, any other resources or file handles.  (We don't want to share these handles with other processes, and we want error and debug messages to go to log files anyways.)
Fork again, closing the parent process after the fork. (Prevents zombies, as any and all child processes will now be "owned" by init, which automatically handles SIGCHLD.

Default TLS context options that I intend to use in the example code, posted here for any discussion:
$options = array(
    'ssl' => array(
        'peer_name' => 'YOUR DOMAIN NAME HERE',
        'verify_peer' => false,
        'local_cert' => 'cert.pem',
        'local_pk' => 'pk.key',
        'disable_compression' => true,
        'SNI_enabled' => true,
        'ciphers' => 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:ECDHE-RSA-RC4-SHA:ECDHE-ECDSA-RC4-SHA:AES128:AES256:RC4-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!3DES:!MD5:!PSK',
    ),
);

Implementation detail note: (In other words, don't count on this behavior anywhere, even here, even if you know that it's happening.)
Stream_socket doesn't give many handy ways to know if a connection is closed, like BSD sockets do.  Adding in WS pings for periodically testing the connection, in cases where a WS close frame is not possible (i.e., unplugged network cable).

At first I was wondering what you are talking about connection closed.  You mean when you reading on the socket. You are right as socket are low-end library you have more control than stream.
Socket can tell you why it fail.  But both have the same behavior to know when you lost connection.
socket_recv return false when a error happen.
fread return false when a error happen.
In both case most likely because you lost connection and you can safely close your side of the connection.
Unless you want to behave differently depending on "why" error happen. You do not need to go deeper than that.

Hi, any news here?

Push!
Hope my question was not ignored since it was issued on April 1st ;-)

Ok, no response. Since I did not want to use ratchet, I played around with PHP-Websockets to achive secure communication. What I did:

installed mod_proxy to Apache
configured mod_proxy to "downgrade" wss to ws using "ProxyPass '/_ws_/' 'ws://<host>:<port>'" and corresponding "ProxyPassReverse"
made a little modification to PHP-Websockets function "run" to concatinate the data read with "socket_recv" prior to do the handshake or split the packets (guess this was an error anyway) and to clear this buffer after handshake/split
start the client with "https"
start the clients websocket connection with "wss://<host>/_ws_/"
the mod_proxy module now downgrades wss to ws (because it finds "/_ws_/" in the URL) and forwards the request to the websocket server at port <port> instead to Apache (at port 443)

So far my websocket communication runs stable with https/wss on only one port (443). No need for an extra port to be opended at the router for the websocket communication due to the usage of the mod_proxy module. So at least for me, a TLS version of PHP-Websockets is not required anymore.
:-))

@mdrmdrmdr I will try to implement your instructions. Thanks so much for sharing the basic steps!  If you can, please answer these questions

Where do you put the ProxyPass directive? .htaccess?

What do you mean by "and corresponding ProxyPassReverse"? Please show your rules

Please show the modified run function. It's difficult for me to know exactly what you did from your description

@PeterElzinga  Would you mind sharing the rest of your websocket class? the snippet you posted relies on modifications you've made elsewhere so it's difficult to implement it

@RoxKilly: I think the proxy code could also go to .htaccess, but I placed it into the file named in the instructions for wstunnel, which is "/etc/apache2/mods-enabled/proxy_wstunnel.load".
My "run" function is attached. Pls note that there are some globel constants used. E.g. CR=\r and NL=\n. Also "msg" is my logging function. U need to replace this.
Note: remove ".txt" from the filenames.
Good luck! ;-)
proxy_wstunnel.load.txt
run.php.txt

@mdrmdrmdr Thanks a ton.  It took me hours to realize that my ProxyPass rules  were not working because I didn't have proxy_wstunnel

I tried your run code but it said CR and NL is undefined

Read the posts carefully then you'll find the answer...

@mdrmdrmdr thanks for your contributions.
A query, when you say: - start the client with "https", how would you do it?
PHP CLI? or from a browser?
Thank you

@guillenexo it means load the https webpage in the browser (the page that will attempt to connect to the websocket via wss://...)

Couldn't have said it better ;-)

thanks!

My server is using HTTPS, so that I can use a ProxyPass to link up the web server and 5GE backed websocket server and encrypt data on the fly

Big thanks to @mdrmdrmdr whose 15 Aug 2016 comment worked perfectly for me. I was able to run TLS (wss://) Websockets through the native SSL Apache server and PHP without changing PHP code. I only changed the HTML file with protocol wss and port to 443. Apache's mod_proxy with ProxyPass and ProxyPassReverse in the virtualhost conf was a genius idea!
Thanks @ghedipunk for PHP-Websockets project. We're able to send broadcast messages to multiple users for a chat server for example. This is not the case with websocketd project which isolates each user.

I used the described solution with mod_proxy and also had to merge the run() function modifications otherwise connection was not successful, only after a few retries (weird!).
Now it's working great, except the fact that I am unable to get a real IP address of connected party. Because mod_proxy is used, socket_getpeername() always returns 127.0.0.1
It would be great to see native WSS support in this library, because whole world is now switched to HTTPS, it should be essential. I think it's not going to happen, this library is dead :(

Not dead.
Just works as intended.
Specifically, it doesn't do any more than it needs to, as it exists as a
layer between tools: your application on the server, and your application
on users' browsers.
I believe that mod_proxy adds the X-Forwarded-For, X-Forwarded-Host, and
X-Forwarded-Server headers, which are available during the handshake.
I have far too much respect for TLS to try to implement it on my own in PHP.
On Wed, Jul 22, 2020 at 3:19 PM Mek notifications@github.com wrote:

I used the described solution with mod_proxy and also had to merge the
run() function modifications otherwise connection was not successful, only
after a few retries (weird!).
Now it's working great, except the fact that I am unable to get a real IP
address of connected party. Because mod_proxy is used, socket_getpeername()
always returns 127.0.0.1
It would be great to see native WSS support in this library, because whole
world is now switched to HTTPS, it should be essential. I think it's not
going to happen, this library is dead :(
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/ghedipunk/PHP-Websockets/issues/41#issuecomment-662702267,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAB46PU4DV2UZ55MGQZWLQ3R45JVNANCNFSM4BIZ4TTA
.

I don't think it "works as intended" because support for WSS is missing and we have to hack it via mod_proxy which has this problem with client IP addresses.
I know there is X-Forwarded-For header, but how do I get to it from webservice code? I don't think it is available at the time when needed...

Easy way to add SSL support is to use stunnel: https://www.stunnel.org/ ... Every Linux distro has, it's very stable and simple to set up.
It doesn't get you the client IP either though, no translation layer will.

authors: Mek7 MichelPoulain NotherGithubAccount PeterElzinga RoxKilly Xaraknid ghedipunk guillenexo lkp111138 mdrmdrmdr nsmith1024 tylorjefcoat

repo: ghedipunk/PHP-Websockets


text:
nginx error dial tcp [::1]:8080: socket: too many open files

gyuminhwangbo@Gyuminui-MacBookPro testing % go run main.go http://localhost:8080/auth/user user 10000
ERROR MESSAGE: Post "http://localhost:8080/auth/user": dial tcp [::1]:8080: socket: too many open files
panic: runtime error: invalid memory address or nil pointer dereference

Solved
By adding more work_processor in nginx.conf, it can be solved!

repo: ghkdqhrbals/spring-chatting-server


text:
Memory Leak

Hello I experienced a memory leak which crashed my async jobs using this gem
This seriously leaks:
10000.times do (puts (Tilt::HandlebarsTemplate.new { "{{enzo}}" }).render({enzo: 'LOL'})) end

This does not Leak:
100000.times do (puts (Tilt::ERBTemplate.new { "<%= enzo %>" }).render(Hashie::Mash.new({enzo: 'LOL'}))) end

I will try to investigate it further today,
Thank you

Possibly related: https://github.com/cowboyd/handlebars.rb/issues/38

:+1:

The Handlebars engine referenced in this issue has been replaced with https://github.com/gi/handlebars-ruby.
i'm going to close this issue because, after testing this with the new engine, there no longer seems to be an issue.

authors: donbobka gi jimothyGator tiredenzo

repo: gi/tilt-handlebars


text:
internationalization of grav-plugin-cookies-policy

Bonjour!
I am a beginner in coding trying to make a multilingual site in fr, ja and en.
I don't have the technical level to make this plugin able to be set according to languages, so, after being told to make an issue here on forum of learn.getgrav.org, I make the issue here.
There must be something to change in the cookiespolicy.yaml... Looking for an experienced hero...
certainly not a big deal, BUT...
THANKS IN ADVANCE!!!

Not yet experienced with Grav multilanguage. I will check it ASAP

☆ Hello Giansi
I just upgraded thrue GPM from 1.0.4 to 1.0.6 thinking that the changes that I made with Sommerregen to internationalize cookiespolicy where included ...
And they were NOT.
The successfull work that we made together with Sommerregen in that direction has been LOST!
I have tried to get things back to previous but, while it's not that complicated, I am starting to become CRAZY.
♪ Please help ☆
I would like to assign to each variables of cookiespolicy.html.twig a value so that It can be displayed in the appropriate language using twig function {{ 'some_string'|t }} (as we have been doing previously).
But this time, I can't get it to work now and I feel ridiculous and also ashamed of contacting Sommerregen again: at the same time, cookiespolicy REALLY NEED to support MULTILANGUAGE.
With Sommerregen, we made a structured language.yaml file like this:

fr:
PLUGINS:
COOKIES_POLICY:
MESSAGE: "En continuant à naviguer sur ce site, vous acceptez l'utilisation de cookies afin de réaliser des statistiques d'audiences et vous proposer des services et une offre adapés à vos centres d'intérêts."
PRIVACY: "En savoir plus"
CLOSE: "Fermer"
URL: "http://francois-vidit.fr/fr/c-u"
ja:
PLUGINS:
COOKIES_POLICY:
MESSAGE: "当サイトはより最適なサービスを提供するためにクッキーを使用しています。このサイトのサービスを利用することで、お客様はサイトがクッキーを使用することに同意したことになります。 "
PRIVACY: "詳細"
CLOSE: "閉じる"
URL: "http://francois-vidit.fr/ja/c-u"
en:
PLUGINS:
COOKIES_POLICY:
MESSAGE: "We use cookies to help us give you the best experience when using our website. Unless you change your settings, we will assume that you agree for us to do this. However, you can change your settings at any time according with your browser."
PRIVACY: "Learn more"
CLOSE: "Close"
URL: "http://francois-vidit.fr/en/c-u"
All the variables of  cookiespolicy.html.twig  are assigned there value according to language: it has been working beautifully until the blind upgrade of yesterday night !!!!
Thanks in advance for your help ♪ and LET'S INTERNATIONALIZE COOKIESPOLICY PLUGIN !

Dear @giansi and @tidiview ,
I've pushed a PR with the changes I made to make Cookie Policy plugin multi-language compatible. Now one can override those strings in a language filer user/languages/<langcode>.yaml, where <langcode> is the two character short code for the country using the keys specified in the languages.yaml.
Have fun!

Thank you guys!

authors: Sommerregen giansi tidiview

repo: giansi/grav-plugin-cookies-policy


text:
ionic3中，限制一张图后，点击相机进行拍照后返回报错

1.使用demo方法
ImagePicker.getPictures(async (result) => {
await this.presentLoading('uploading');
console.log('result is ↓');
console.log(result);
if (result && result.images.length !== 0) {
const imgList = await _.cloneDeep(result.images);
await imgList.forEach(i => {
this.getImgToBase64Code(i.uri);
});
}
}, (err) => {
console.log(err);
console.log('imagePicker Error↑');
}, {
maximumImagesCount : 2,
quality : 50,
enablePickOriginal: false,
});
2.getImgToBase64Code方法
getImgToBase64Code(resFilePath) {
const filePath: string = this.webview.convertFileSrc(resFilePath);
this.base64.encodeFile(filePath).then((base64File: string) => {
this.imgList.push({
attId: null,
fileName: new Date().getTime() + '.jpeg',
base64Code: base64File,
url: filePath,
innerUrl: ''
});
// await setTimeout(() => {
//  this.showImgList = false;
//  this.closeLoading();
//  this.showImgList = true;
// }, 2000);
}, (err) => {
console.log(err);
alert(err);
});
}
3.模拟器中log报错
Received memory pressure event 2 vm pressure 0
2020-05-21 10:45:21.529913+0800 APP[14272:1358689] [GatekeeperXPC] Connection to assetsd was interrupted or assetsd died
2020-05-21 10:45:21.599179+0800 APP[14272:1358604] [ProcessSuspension]  0x28162b2c0 - ProcessAssertion() Unable to acquire assertion for process with PID 0
2020-05-21 10:45:28.040734+0800 APP[14272:1358613] [error] error: XPC: synchronousRemoteObjectProxyWithErrorHandler encountered error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection from pid 0 was invalidated." UserInfo={NSDebugDescription=The connection from pid 0 was invalidated.}
CoreData: error: XPC: synchronousRemoteObjectProxyWithErrorHandler encountered error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection from pid 0 was invalidated." UserInfo={NSDebugDescription=The connection from pid 0 was invalidated.}
2020-05-21 10:45:28.051633+0800 APP[14272:1358613] CoreData: XPC: sendMessage: failed #0
2020-05-21 10:45:28.955553+0800 APP[14272:1357420] location:<+31.26448857,+121.48600270> +/- 1414.00m (speed -1.00 mps / course -1.00) @ 2020/5/21 中国标准时间 10:45:17
2020-05-21 10:45:29.004939+0800 APP[14272:1358989] [ImageManager] First stage of an opportunistic image request returned a non-table format image, this is not fatal, but it is unexpected
2020-05-21 10:45:30.044900+0800 APP[14272:1357420] Luban-iOS image data size before compressed == 6438.629883 Kb
2020-05-21 10:45:30.424797+0800 APP[14272:1357420] Luban-iOS image data size after compressed ==88.625977 kb
2020-05-21 10:45:30.438534+0800 APP[14272:1357420] All finished.
2020-05-21 10:45:32.144812+0800 APP货[14272:1357420] Ionic Native: deviceready event fired after 2526 ms
2020-05-21 10:45:32.153639+0800 APP[14272:1358688]  | JIGUANG | D - [JIGUANGService] Action - setDebugMode
请问有什么解决办法吗？感谢。

ionic How do you use it

authors: Wgga carolinetanxin

repo: giantss/cordova-plugin-ImagePicker


text:
Remove apps of default-apps-cloud-director

These apps are already part of https://github.com/giantswarm/default-apps-cloud-director

on ⎈ glados-admin@glados (org-multi-project) cloud-director-app-collection on  remove-default-apps
➜ k get app -A |grep already
org-giantswarm   glados-cert-exporter                                       13d                          already-exists
org-giantswarm   glados-kube-state-metrics                                  13d                          already-exists
org-giantswarm   glados-metrics-server


text:
Add and update titles, descriptions in values schema

Towards https://github.com/giantswarm/roadmap/issues/2096
Here we are adding annotations (title, description, sometimes examples) to the schema to help understand all properties.
Checklist

[x] Update changelog in CHANGELOG.md.
[x] Make sure values.yaml and values.schema.json are valid.
[ ] Update Lastpass values if required.

@giantswarm/team-rocket I have some questions here regarding the meaning of some properties. See the inline comments.

I think I replied to all of them, let me know if you need more details 🙂
Thanks for improving this !

@vxav Thanks for the input! I did my best to integrate it in a readable fashion. Would be happy about a review then.

authors: marians vxav

repo: giantswarm/cluster-cloud-director


text:
App chart, RBAC/PSP for docs

Towards https://github.com/giantswarm/giantswarm/issues/7349
This migrates the former helm chart to the new app-operator compatible chart. It also adds RBAC/PSP things that were missing so far to run the workload without root privileges and use EmptyDir type
volumes.

This is now running in a cluster for test purposes. See https://github.com/giantswarm/tenant-cluster-installations/pull/40 for the app manifest.

repo: giantswarm/docs


text:
Choose some sane defaults for container ressource settings

See these:

https://prometheus.io/docs/operating/storage/#memory-usage
http://kubernetes.io/docs/user-guide/compute-resources/#example

No longer valid

repo: giantswarm/kubernetes-prometheus


text:
Allow enabling the enable-ssl-chain-completion flag.

After upgrading to latest version of the IC in viking the ingress endpoints started having SSL errors.
In viking we use customer provided certificates that lack the intermediate chain.
The reason why it stopped working during the upgrade is that we changed the value for enable-ssl-chain-completion flag to false. Without that feature, the certificates are invalid.
This PR allows the possibility to enable this feature on demand.
Tests on workload clusters (not always required)
In order to verify that my changes also work on, I did the following tests:
AWS

[ ] Upgrade from previous version works
[ ] Existing Ingress resources are reconciled correctly (change domain, see if its available)
[ ] Fresh install works
[ ] Fresh Ingress resources are reconciled correctly

Azure

[ ] Upgrade from previous version works
[ ] Existing Ingress resources are reconciled correctly (change domain, see if its available)
[ ] Fresh install works
[ ] Fresh Ingress resources are reconciled correctly

KVM
Hint:
kubectl port-forward -n kube-system svc/nginx-ingress-controller-app 8080:80
curl -H "Host: host.configured.in.ingress" localhost:8080

[ ] Upgrade from previous version works
[ ] Existing Ingress resources are reconciled correctly (change domain, see if its available)
[ ] Fresh install works
[ ] Fresh Ingress resources are reconciled correctly

Tested an upgrade on a MC, all good

repo: giantswarm/nginx-ingress-controller-app


text:
CAPA private cluster templating

Stories
-As a cluster operator, I want to generate the private and proxy enabled cluster definition with kubectl-gs in order to follow best practices recommended by Giant Swarm.
-As a Giant Swarm developer, I want to generate the cluster definition with kubectl-gs in order to easily create a private and proxy enabled workload cluster to test my changes.
Details
Add an optional argument to kubectl-gs called --cluster-type which allows users to render different types of clusters. The user gets a public cluster if the flag is not specified.
$ kubectl gs template cluster --cluster-type private ...

Current cluster types (possible values for --cluster-type):

public: current behavior. The user gets a public cluster;
private: the user gets a private cluster (without proxy configuration). Currently, with CAPA the cluster will not start because there's no way to access the Internet. It will be supported later. This option should not be enabled in kubectl-gs until CAPA has support for it. Do not implement it as part of this story;
proxy-private: the user gets a private cluster with proxy configuration (already supported by CAPA, see an example definition bellow).

Requirements

kubectl-gs has the current behavior if --cluster-enabled is not specified. It renders a public cluster;
kubectl-gs renders a private proxy enabled cluster if --cluster-type proxy-private if set. See definition example bellow;
kubectl-gs requires additional arguments to be passed in if --cluster-type proxy-private is set:

--https-proxy: HTTPS_PROXY, https_proxy value;
--vpc-cidr

kubectl-gs allows the user to pass a few optional arguments:

--http-proxy: HTTP_PROXY, http_proxy value. Defaults to the value of --https-proxy if not specified;
--no-proxy: NO_PROXY, no_proxy value.

kubectl-gs will split the value of --vpc-cidr into 4 equal blocks and will use the first X number of blocks as the value for network.subnets in values.yaml. X is the number of availability zones to be used by the cluster. See definition example bellow;
kubectl-gs will set network.vpcMode, network.apiMode and network.dnsMode to private in values.yaml. See definition example bellow;

Examples
CAPA private cluster definition with proxy configuration (--cluster-type proxy-enabled):
---
apiVersion: v1
data:
  values: |
    aws:
      region: eu-west-2
      awsClusterRole: default2
    bastion:
      enabled: false
    proxy:
      enabled: true
      http_proxy: "http://internal-a1c90e5331e124481a14fb7ad80ae8eb-1778512673.eu-west-2.elb.amazonaws.com:4000"
      https_proxy: "http://internal-a1c90e5331e124481a14fb7ad80ae8eb-1778512673.eu-west-2.elb.amazonaws.com:4000"
      no_proxy: "test-domain.com"
    clusterName: alextest36
    controlPlane:
      replicas: 1
    machinePools:
    - instanceType: m5.xlarge
      maxSize: 10
      minSize: 3
      name: machine-pool0
      rootVolumeSizeGB: 300
      availabilityZones:
      - eu-west-2a
      - eu-west-2b
      - eu-west-2c
    network:
      vpcCIDR: 10.20.0.0/16
      topologyMode: GiantSwarmManaged
      availabilityZoneUsageLimit: 3
      vpcMode: private
      apiMode: private
      dnsMode: private
      subnets:
      - cidrBlock: 10.20.0.0/18
      - cidrBlock: 10.20.64.0/18
      - cidrBlock: 10.20.128.0/18
    organization: giantswarm
kind: ConfigMap
metadata:
  creationTimestamp: null
  labels:
    giantswarm.io/cluster: alextest36
  name: alextest36-userconfig
  namespace: org-giantswarm
---
apiVersion: application.giantswarm.io/v1alpha1
kind: App
metadata:
  labels:
    app-operator.giantswarm.io/version: 0.0.0
  name: alextest36
  namespace: org-giantswarm
spec:
  catalog: cluster
  config:
    configMap:
      name: ""
      namespace: ""
    secret:
      name: ""
      namespace: ""
  kubeConfig:
    context:
      name: ""
    inCluster: true
    secret:
      name: ""
      namespace: ""
  name: cluster-aws
  namespace: org-giantswarm
  userConfig:
    configMap:
      name: alextest36-userconfig
      namespace: org-giantswarm
  version: 0.20.2
---
apiVersion: v1
data:
  values: |
    clusterName: alextest36
    organization: giantswarm
kind: ConfigMap
metadata:
  creationTimestamp: null
  labels:
    giantswarm.io/cluster: alextest36
  name: alextest36-default-apps-userconfig
  namespace: org-giantswarm
---
apiVersion: application.giantswarm.io/v1alpha1
kind: App
metadata:
  labels:
    app-operator.giantswarm.io/version: 0.0.0
    giantswarm.io/cluster: alextest36
    giantswarm.io/managed-by: cluster
  name: alextest36-default-apps
  namespace: org-giantswarm
spec:
  catalog: cluster
  config:
    configMap:
      name: alextest36-cluster-values
      namespace: org-giantswarm
    secret:
      name: ""
      namespace: ""
  kubeConfig:
    context:
      name: ""
    inCluster: true
    secret:
      name: ""
      namespace: ""
  name: default-apps-aws
  namespace: org-giantswarm
  userConfig:
    configMap:
      name: alextest36-default-apps-userconfig
      namespace: org-giantswarm
  version: 0.12.3

@giantswarm/team-rainbow What do you think about adding a new flag to kubectl-gs which allows the rendering of private clusters instead of public ones for supported providers.
This most probably applies only for cloud providers. @cornelius-keller , @gawertm Do you see any benefits for onprem?

Currently we are not using kubectl GS, but this might change with capvcd and Panamax. Ideally we would want to work Panamax with gitops from the beginning as well.
But it makes total sense to me to introduce and align on this flag where we create private clusters with kubectl GS.

https://github.com/giantswarm/kubectl-gs/pull/991

authors: alex-dabija bdehri cornelius-keller

repo: giantswarm/roadmap


text:
Document prometheus-agent

Towards: https://github.com/giantswarm/giantswarm/issues/23130
We need to document the changes introduced with prometheus-agent as this as various implication and impact.
This documentation would mainly be aimed at customer, since this will impact them, so we need to describe what changes for customer.
We also need to describe how and why we came to this conclusion in order to provide more context and help understand why this is happening.
This documentation should be public and live somewhere there https://github.com/giantswarm/docs/tree/main/src/content/ui-api/observability which translate into this public url https://docs.giantswarm.io/ui-api/observability/

https://github.com/giantswarm/docs/pull/1709

authors: QuentinBisson TheoBrigitte


text:
Use Karpenter on CAPZ

Karpenter can be used on Azure using this upstream repo : https://github.com/Azure/karpenter-provider-azure in self hosted mode.
We should thus adapt the karpenter-bundle app to make it work on CAPZ.

In our GS environment, karpenter is deployed using the karpenter-bundle app which in turns deploy 3 apps :

karpenter-app
capa-karpenter-taint-remover
karpenter-crossplane-resources

So the first step to have it working on CAPZ is to know which of these apps work out-of-the-box in a CAPZ environment (if there are any) and then adapt those that are not accordingly.

After deploying the capa-karpenter-taint-remover app on glean, I noticed that it worked perfectly without having to update the app itself, so nothing to do here except renaming the app.
Issues are arising when it comes to the karpenter-crossplane-resources app. Indeed this app is deploying AWS specific resources  such as IAM and SQS related ones. Therefore, this app definitely needs to be updated to support CAPZ deployment;
Concerning karpenter-app, as the app relies on a <cluster_id>-crossplane-config configmap to be deployed but crossplane is not deployed on glean, there's no such cm in the cluster and thus I couldn't deploy the app. However by removing the extraConfig field related to this one in the app CR it deployed nicely even though the pod was crashlooping (which was expected as it wasn't running in the adequate environment as of the time of testing).

So the remaining things to do are :

[ ]  Rename capa-karpenter-taint-remover app to capi-karpenter-taint-remover as well as all other CAPA mentions inside the app's repo.
[ ] Update the karpenter-crossplane-resources with the resources required to have Karpenter running on Azure

[ ]  Find which custom resources are needed for karpenter on Azure.

[ ] Deploy the karpenter-bundle app on glean using the standard procedure (nodepool + provisionner creation) and make it work.


text:
Remove app from app name

I didn't modify the collections to avoid re-deploying the apps for now.
Checklist

[ ] Update changelog in CHANGELOG.md.
[ ] Make sure values.yaml and values.schema.json are valid.

Important: After this PR is tested and approved, ensure you "Squash and Merge" unless you are updating a subtree. The release automation in use on this repository relies on squashing, but git subtrees will be lost if squashed. This repo allows both, so you may need to change the merge type when merging.

I think this is failing because we haven't pushed to the catalog yet?
2022-10-25 20:11:32,577 step_exec_lib.steps ERROR: Error when running build step for UpgradeTestScenario: Application deployment failed: App 'trivy' was not found in the 'index.yaml' fetched from 'https://giantswarm.github.io/giantswarm-catalog/index.yaml'.

Changing the catalog for tests made it work:
https://app.circleci.com/pipelines/github/giantswarm/trivy-app/370/workflows/4d8d8a6c-0dee-445f-a4db-fa5c787b6823/jobs/853/parallel-runs/0/steps/0-104
Wondering if it makes sense using the giantswarm-catalog at all since apps won't reach there until we release.

Should we rename the app in the collections too? Would this cause to have two trivys in MCs?
Is it more convenient to just leave the app as it is in collections and just change the trivy-operator configmap through config?

We can just disable the upgrade tests here for now https://github.com/giantswarm/trivy-app/blob/8aa3a608ad3446a446c0544b1445e2bcb46e98df/.ats/main.yaml#L3
We want to test against the last "real" release, so the catalog should still be giantswarm (otherwise we test upgrade against whatever random thing got pushed to the test catalog last). But yes upgrade will fail until we've released a tagged version to that catalog
As far as collections, this will give us duplicate deployments. We'll have to remove the existing app from the collections. I'd suggest once this is tested and ready to go we can wire up collections PRs and merge them just before we release this

Renamed the catalog back and disabled upgrade tests for now until we have it in the catalog with the new name.
This should be fine to release. Any thoughts @stone-z ?

authors: fhielpos stone-z

repo: giantswarm/trivy-app


text:
Sea of Thieves achievement not displaying

The achievement for Sea of Thieves entitled "#BeMorePirate" doesn't show up, perhaps something to do with the # symbol?

Looks like this code in Manager.cs is causing it to show up as achievement ID "19" as the label instead of the real name "#BeMorePirate".  I'm not sure why this code is implemented this way, since it seems to show up fine in the list if you remove this block of code.
if (item.Text.StartsWith("#", StringComparison.InvariantCulture) == true)
{
item.Text = info.Id;
}
else
{
item.SubItems.Add(info.Description);
}

This is legacy code from around when I first made SAM, there was a game, one of Valve's, I think, that had localization string IDs instead of a real description.

authors: gibbed jsdratm

repo: gibbed/SteamAchievementManager

license: Zlib


text:
Request for translations.json doesn't include base_url when latter is set.

When the base_url is set to a non empty value, the front end isn't including the base_url in the request made for translations.json.  This is related to similar problems in #189 and #200.

This issue is hopefully addressed by PR #280.

repo: gilbitron/Raneto


text:
downAddClass,upRemoveClass on Async nodes not working properly ?

Hi,
I've noticed that when scrolling to view on node elements that have asynchronous data, such as Google Maps or Twitter it doesn't toggle the className at the correct frame. I've tried to trigger the window resize event to see if spark-scroll recalculates the frame break points but it doesn't seem to work. I'm still trying to figure out what's causing this, but it's only happening on async data where I don't know the height of the element in advance. By the way, the app is responsive.
I'd like to know if there's a way to force spark to recalculate this points for me once the promises are resolved ?
Thanks for looking!

Sorry, just found about sparkSetup.enableInvalidationInterval(ms), but not sure if that's the right answer, I guess I should have a way to trigger the formula recalculation on demand instead of delaying the formula calculation process that seems to be the case with this operation ?

My bad! Just need to broadcast sparkInvalidate on current spark scope or rootScope, $rootScope.$broadcast('sparkInvalidate');
Thanks!

repo: gilbox/spark-scroll


text:
Fixing Japanese values

Hi
The target_lang value when using Japanese was different from the official value, so it has been fixed.
https://www.deepl.com/docs-api/other-functions/listing-supported-languages/

Didn't know the value changed. I'll publish it right now!
Dōmo arigatōgozaimashita!

authors: eggpogg gillescoolen

repo: gillescoolen/deepl-client


text:
A very well written documentation

It would be better if a very well written documentation is supplied.which gives the user all the end to end details of setting up licode especiall what he should do when behind NAT and what are recommended ports for port forwarding in case of UDP and a FAQ page .A contributer or developer manual could also make the licode commmunity have a good number of new contributors too.

I am planning to learn the source code structural base of licode.so can any one help me by mentoring.

I am trying the understanding the licode source code and the links between different parts of licode architecture.I find all javascript source files being imported or implementing some important functionality.but why there is this folder which is being built using cmake https://github.com/ging/licode/tree/master/erizo ?
where and how is the source code of this folder being used in the licode architecture?

Licode's SFU/MCU (Erizo) is written in C++. ErizoAPI is a node.js addon that wraps it so it can be used in node apps. #335 for more details.

authors: lodoyun nikhilrayaprolu

repo: ging/licode


text:
Extract prefix sum computations

This PR introduces a new prefix_sum kernel that is used instead of manually computing prefix sums in different places. This also fixes two bugs:

In CUDA/HIP ParILU, the wrong num_blocks is used for launching the prefix sum kernels
In Reference ParILU, the handling of non-existent diagonals is incorrect.

Finally, it removes a few unnecessary calls to Array::clear since they would be cleaned up via RAII anyways.

@pratikvn No, you are probably right. So would something like */component/prefix_sum.* make more sense? Also I should at least add 1-2 tests for this kernel.

@upsj , Yes, that sounds good to me.

Do you want to solve the par_ilu here? or another PR.

No, that would involve having to add another kernel, I will have to do that in another PR.

authors: pratikvn upsj

repo: ginkgo-project/ginkgo


text:
bug in $ref type in section

when add new item for input type with $ref type in first child element is excellent
but if I create section and in section create element by ref type, hole of form is hide and this error wrote in console
ERROR Error: An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the "Pause on exceptions" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue.
I using this package in angular project and my customFormInputs of mods code is :
customFormInput0: {                 displayName: "Upload photo",                 defaultDataSchema: {                     $ref: "#Photo",                     "type": "string",                 },                 defaultUiSchema: {                     "ui:widget": "simpleUploadImage",                 },                 type: "number",                 matchIf: [{                     types: ["string"],                     widget: "simpleUploadImage",                 }],             }

@mahdi-hajian as far as I can tell, the $ref in your custom form input is invalid. It needs to refer to some other part of the schema, likely the part that begins with #/definitions/

authors: mahdi-hajian raymond-lam


text:
popup menu flickers

The completion window flickers seriously, is there any way to alleviate it?

What command are you trying to complete?
If this is related to file completion, and you have thousands of files then it is explainable. Vim redraws the popup window when you update it through async search.

If I were to guess you are seeing screen flicker in commands (:) but not while searching (/). If so, it is an artifact of wildmenu completion. I don't notice flicker usually as I have a fast computer, but I can see if I observe carefully. It is possible to eliminate flicker completely by replacing wildmenu/pmenu popup with newer popup_create(). I'll put this on my todo list. You are the first one who raised this issue.

If I were to guess you are seeing screen flicker in commands (:) but not while searching (/).

you are right. flicker occurs in : not /.
/ works fine, no flicker.

I could not muster enough motivation to do this enhancement (since it does not bother me). I also have a small kid and finding time is not easy. I am closing this since there is not point keeping this open.

I truly understand you and also appreciate your contributions to the Vim plugin community. If anyone wishes to solve this issue, this plugin might be useful.

authors: Song-Tianxiang girishji


text:
Problem with "size" param support in geohash aggregation

In gitlab by @sfalquier on May 3, 2017, 14:34
A _geoaggregation request makes different values for features.properties.count of a given point when using different "size" parameter.
For example :

geohash:centroid:interval-1
{
"type": "Feature",
"properties": {
"geohash": "s00000000000",
"elements": null,
"count": 25
},
"geometry": {
"type": "Point",
"coordinates": [
0,
0
]
}
}
...

geohash:centroid:interval-1:size-1
{
"type": "Feature",
"properties": {
"geohash": "s00000000000",
"elements": null,
"count": 23
},
"geometry": {
"type": "Point",
"coordinates": [
0,
0
]
}
}

In gitlab by @sfalquier on May 3, 2017, 14:39
made the issue confidential

In gitlab by @sylvaingaudan on Jul 17, 2017, 15:06
added ~2291850 label

In gitlab by @sfalquier on Jul 21, 2017, 11:24
added ~1918908 label

In gitlab by @sfalquier on Jul 21, 2017, 11:24
removed ~1918908 label

In gitlab by @sylvaingaudan on Sep 11, 2017, 11:48
changed milestone to %13

In gitlab by @sfalquier on Sep 15, 2017, 11:00
removed milestone

repo: gisaia/ARLAS-server


text:
Broken link to figures from Section 5.1

The links to Figures 5-2 and 5-3 at https://git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows are broken.

I have found that many links across the book-site are broken. Another example: "The Perils of Rebasing" on https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#Undoing-Merges

This should be fixed now.

Since this is resolved, I'll go ahead and close this issue.

authors: douglasnaphas jnavila maxlazio paul-bjorkstrand


text:
git help svn should briefly describe propset

git help svn does not mention propset. It does mention proplist and propget. This seems like an oversight.
$ git help svn
...
       proplist
           Lists the properties stored in the Subversion repository about a given file or directory.
           Use -r/--revision to refer to a specific Subversion revision.

       propget
           Gets the Subversion property given as the first argument, for a file. A specific revision
           can be specified with -r/--revision.
...

Interestingly, the generic git svn help does mention propset!
$ git svn
...
  propget          Print the value of a property on a file or directory
                     --revision, -r <num>
  proplist         List all properties of a file or directory
                     --revision, -r <num>
  propset          Set the value of a property on a file or directory - will be set on commit
...

It seems Documentation/git-svn.txt is missing text for propset.

Oops, wrong repository!


text:
我这里不能使用Gitalk

使用Jekyll博客。
但是我在之前的博客主题里可以使用gitalk，而现在这个不行。我看了看，没输错啊。
<script src="https://unpkg.com/gitalk@latest/dist/gitalk.min.js"></script>
<script type="text/javascript">
setTimeout(function () {
      var gitalk = new Gitalk({
        clientID: "--",
        clientSecret: "--",
        repo: "SunTalk_Save",
        owner: "SunbossRS",
        admin: ["SunbossRS"],
        id: location.pathname,      // Ensure content need to less or equal 50 charters. Can use {{ page.title }}
        distractionFreeMode: true  // Facebook-like distraction free mode
      });
      gitalk.render('git_thread')
}, 1000)
</script>
<script src="https://unpkg.com/gitalk@latest/dist/gitalk.min.js"></script>

由于我怕不奏效所以引用两次script

repo: gitalk/gitalk


text:
🛑 invidious.kavin.rocks is down

In 5d971cd, invidious.kavin.rocks (https://invidious.kavin.rocks/) was down:

HTTP code: 502
Response time: 1003 ms

Resolved: invidious.kavin.rocks is back up in 9d8a190 after 12 minutes.

repo: gitetsu/invidious-instances-upptime


text:
🛑 librex.nekus.gay is down

In 09e5d42, librex.nekus.gay (https://librex.nekus.gay/) was down:

HTTP code: 403
Response time: 759 ms

Resolved: librex.nekus.gay is back up in a4d26fc.

repo: gitetsu/librex-instances-upptime


text:
Feat: Configuration, azd support, proxy API

This PR contains changes from @jycr since I needed those to make container configurable.
Need to update documentation but from my testing it looks like both options still work:

running just frontend - using PAT
running frontend with backend - using GitHub App

fixes #25  and #30

We're working on that internally, if you wanted to deploy it (to Azure) - there's a one click deploy here:
https://github.com/karpikpl/copilot-metrics-viewer/tree/feature/configuration?tab=readme-ov-file#azure-deployment

I've tried deploying both the copilot-metrics-viewer and copilot-metrics-viewer-with-api images and cannot seem to get either to work.  For the copilot-metrics-viewer, I've set
VUE_APP_SCOPE=enterprise
VUE_APP_GITHUB_ENT=[REDACTED]
VUE_APP_GITHUB_TOKEN=[REDACTED]
I've verified both inside the container and outside that:
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer $VUE_APP_GITHUB_TOKEN" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/enterprises/$VUE_APP_GITHUB_ENT/copilot/usage

returns reasonable data.  When I browse via the container, there's an error message "404 Not Found - is the enterprise [REDACTED] correct"

ok, I'll test it. The API Proxy is designed to work with GH app registration rather than hardcoded token

sure, I need to resolve the conflicts - will fix it this weekend

@martedesco @dcieslak19973 I resolved conflicts and updated the readme.
you can run the project in few different ways

With hardcoded token - that's hidden by the proxy

docker run -it --rm -p 3000:3000 \
-e VUE_APP_SCOPE=enterprise \
-e VUE_APP_GITHUB_API=/api/github  \
-e VUE_APP_GITHUB_ENT=<enterprise name> \
-e VUE_APP_GITHUB_TOKEN=<github PAT> \
-e SESSION_SECRET=<random string>  \
ghcr.io/karpikpl/copilot-metrics-viewer-with-proxy

or
docker run -it --rm -p 3000:3000 \
-e VUE_APP_SCOPE=organization \
-e VUE_APP_GITHUB_API=/api/github  \
-e VUE_APP_GITHUB_ORG=<org name> \
-e VUE_APP_GITHUB_TOKEN=<github PAT> \
-e SESSION_SECRET=<random string>   \
ghcr.io/karpikpl/copilot-metrics-viewer-with-proxy

With GitHub Authentication - that authenticates and authorizes the user with GitHub App registration

docker run -it --rm -p 3000:3000 \
-e VUE_APP_SCOPE=organization \
-e VUE_APP_GITHUB_API=/api/github  \
-e VUE_APP_GITHUB_ORG=<org name> \
-e GITHUB_CLIENT_ID=<client id> \
-e GITHUB_CLIENT_SECRET=<client secret for the GH App> \
-e SESSION_SECRET=<random string>  \
ghcr.io/karpikpl/copilot-metrics-viewer-with-proxy

@karpikpl , thanks for the recent commits! I had to release the 1.7 without this for now as there was much demand for the Team metrics availability. I will have to run some tests on the content of this PR so this one should be prioritized next! Please bear with me 🙏🏼

Feel free to ping me on teams - we can sync about this solution

@martedesco were you able to test this?

We're working on that internally, if you wanted to deploy it (to Azure) - there's a one click deploy here: https://github.com/karpikpl/copilot-metrics-viewer/tree/feature/configuration?tab=readme-ov-file#azure-deployment

I'm interested in the azure deploy but am not sure how to deploy it based on this information. How would I go about doing that?

We're working on that internally, if you wanted to deploy it (to Azure) - there's a one click deploy here: https://github.com/karpikpl/copilot-metrics-viewer/tree/feature/configuration?tab=readme-ov-file#azure-deployment

I'm interested in the azure deploy but am not sure how to deploy it based on this information. How would I go about doing that?

Apology for stale link.
You have several options here:

Use the fork and follow this readme (now in dedicated file: https://github.com/karpikpl/copilot-metrics-viewer/blob/feature/configuration/DEPLOYMENT.md
Deploy image build from https://github.com/github-copilot-resources/copilot-metrics-viewer using guidance in #95


text:
Is normalize.css still needed?

It seems maybe normalize.css could be tossed out as well? Many random comments along the lines of https://www.reddit.com/r/webdev/comments/10kqgju/how_relevant_is_normalize_css_in_2023/
Originally posted by @mlinksva in https://github.com/github/choosealicense.com/issues/1136#issuecomment-1694110628

solved  #1137
Most don't need it, but it's not bad either. It depends on what you're building.
I think it's easy today to standardize what you need when/when you need it.
But let's say you build a centimeter. Users will type all kinds of crap and you don't know how they will use it or what to do, so you're probably normalizing everything in your theme/view.

authors: mlinksva sahilpannu