Feature request: Rewrite some of the functionality of VueWrapper and align the vue API.

Is your feature request related to a problem? Please describe.

In the process of fixing #2116, I've come to realize that VueWrapper.vm's position is to enable testers to debug and modify setupState. If that's correct, then it's probably not a good idea to require VueWrapper.vm to exercise the ExposeProxy function.
Describe the solution you'd like

In reading the vue/core sources, I found that Evan You implements ref reflection by assigning an ExposeProxy to the ref if the component has exposed properties, and a ComponentPublicInstance to the ref otherwise. code:@vue/core/rendererTemplateRef
Maybe we need to add a new property such as: exposed / exposeProxy. to easily access the exposed properties of the component.
An implementation of exposeProxy can be aligned to @vue/core/component.
If it's okay with you guys, maybe I'll try to do it.

I wouldn't say we've got a specific position. The general development lifecycle for this library is just to assess and add things on a case by case basis, depending on what people want.
What I've seen historically is something like

User asks for feature to do X
Other users suggest alternative ways to do X
If the proposed solution is adequate, go with that
If it's not, discuss new / alternative / changes

In general, I think we want to avoid adding new features unless they solve a unique use case. If you think you have a use case for something like a exposeProxy, it might  be worth sharing it before writing too much code.
In my opinion tampering with the component isn't good, it's better to just interact like a user does (click, etc) but happy to discuss more!

@jason-chang We can already access everything that is exposed (and not exposed) by the component on the VM, so I don't think we need to add another property.
If you have a specific use case that can't be done currently, feel free to ping us with a repro and we'll gladly reopen and discuss!


[Snyk] Upgrade @astrojs/check from 0.6.0 to 0.9.4

Snyk has created this PR to upgrade @astrojs/check from 0.6.0 to 0.9.4.
:information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.

The recommended version is 10 versions ahead of your current version.

The recommended version was released 3 months ago.

Release notes

Package name: @astrojs/check

0.9.4 - 2024-10-04

0.9.3 - 2024-08-18

0.9.2 - 2024-08-06

0.9.1 - 2024-07-31

0.9.0 - 2024-07-31

0.8.3 - 2024-07-25

0.8.2 - 2024-07-17

0.8.1 - 2024-07-10

0.8.0 - 2024-07-08

0.7.0 - 2024-05-15

0.6.0 - 2024-05-07

    from @astrojs/check GitHub release notes

[!IMPORTANT]

Check the changes in this PR to ensure they won't cause issues with your project.
This PR was automatically created by Snyk using the credentials of a real user.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information:

🧐 View latest project report
📜 Customise PR templates
🛠 Adjust upgrade PR settings
🔕 Ignore this dependency or unsubscribe from future upgrade PRs

Now at 0.9.4


storage class set to tier2 on uploads

Explain the changes

Previously uploads to TMFS would set the blocks to migrate immediately, but the first tier was used and the object storage class did not represent the correct tier.
Now the selected tier on upload will take into account the configuration and set the proper tier right when the object creates.
This is probably not the last iteration on this, because we also want to postpone the update to the second tier only once the blocks are actually migrated, instead of upon triggering the migration, but for now this is an improvement of the storage class reporting.

Issues: Fixed #xxx / Gap #xxx

NA

Testing Instructions:
> alias s3='aws --endpoint http://localhost:6001 s3'
> alias s3api='aws --endpoint http://localhost:6001 s3api'
> s3 cp README.md s3://first.bucket
> s3api head-object --bucket first.bucket --key README.md
{
    "AcceptRanges": "bytes",
    "LastModified": "2023-07-06T08:00:00+00:00",
    "ContentLength": 2387,
    "ETag": "\"a00e1a5fb5c7ad1fc1a215825d1ce03a\"",
    "ContentType": "text/markdown",
    "Metadata": {},
    "StorageClass": "GLACIER_IR"
}

@guymguym if we simply remove the immediate migration code from our upload flows (_write_block) then that should work as well right? After TIERING_TTL_MS ms the TTL worker is going to migrate and change the storage class anyway, right?

@guymguym if we simply remove the immediate migration code from our upload flows (_write_block) then that should work as well right? After TIERING_TTL_MS ms the TTL worker is going to migrate and change the storage class anyway, right?

@utkarsh-pro OK so not exactly, because now with this fix on upload we will select tier2, so TTL/TTF workers will not pick up the chunks because they only look on tier1... This means that once we want to change the migration to be on the background, we should also change the upload flow to choose tier1 again.

@guymguym if we simply remove the immediate migration code from our upload flows (_write_block) then that should work as well right? After TIERING_TTL_MS ms the TTL worker is going to migrate and change the storage class anyway, right?

@utkarsh-pro OK so not exactly, because now with this fix on upload we will select tier2, so TTL/TTF workers will not pick up the chunks because they only look on tier1... This means that once we want to change the migration to be on the background, we should also change the upload flow to choose tier1 again.

I meant that instead of this fix if we simply remove the immediate migration then that should achieve the same goal as this PR does right?
So writes will simply write to tier1 and storage class is set to STANDARD. After TIERING_TTL_MS time, TTL worker identifies the blocks and migrates them to the next tier.

I meant that instead of this fix if we simply remove the immediate migration then that should achieve the same goal as the fix in this PR does right?
So writes will simply write to tier1 and storage class is set to STANDARD. After TIERING_TTL_MS time, TTL worker identifies the blocks and migrates them to the next tier.

Right. This is for the time being until we decide how to go about object storage classes and deferring migrations.


Update the Attachment component to accept a new parameter

Trello card
What
Update the Attachment component to accept new parameter for custom thumbnails.

Why
We want to remove attachment rendering functionality out of Whitehall and instead use the functionality provided by the Govspeak gem (it uses govuk_publishing_components to render attachments so we need to update the Attachment component here to support PDF preview thumbnails).
Visual Changes
The will be no visual change - thumbnails for PDF attachments should be rendered the same way as with previous implementation.

@baisa just had a very quick look now, your changes look good (withstanding Andy's comments). I'm not 100% sure on the alt text so want to look that up further and will get back to you.

The CSP issue should be resolved by us merging: https://github.com/alphagov/govuk_publishing_components/pull/3353 and then rebasing this from that

Thank you both @kevindew @andysellick I have rebased against main so I believe now I just need to wait for merging of https://github.com/alphagov/govuk_publishing_components/pull/3353 to get this change through 👍

Thanks @baisa do you mind reviewing https://github.com/alphagov/govuk_publishing_components/pull/3353 ?

Thanks @baisa do you mind reviewing #3353 ?

Yes, it is done @kevindew 👍


fix for https://stackoverflow.com/q/70549682/592355

"alternative" (facts;) jetty plugin
fix for https://stackoverflow.com/q/70549682/592355
sorry for formatting, please "ignore whitespace"

here is no code changes! ;)


Handle zero-length files with no read permission

These files appear for example in clang's test suite, for testing the behaviour of tooling when it tries to read files it lacks the permission for. So this is a step towards being able to store more directories without manual intervention.
Closes #14.
TODO

[x] Tests
[x] Haven't actually tried non-loose extract yet which isn't yet implemented and won't work right.

I consider this ready for review and testing but please leave the merging to me, I want to test it a bit more first.


Svelte 2.24.0 TextField issue with bind:value

Per @bradak1 report on discord, we've upgraded svelte to 2.24.0 and have issues with TextField and 2-way binding.  I've modified the example code on a forked branch to demonstrate (text-fields.svelte):

The initial value always restores itself
When replacing the value it resets to intial value when focus changes
When editing the value it jumps to the end of the string after a single character is inserted

Here is a demo:

...I'm still grokking why this is happening and don't yet have a fix. Not 100% sure this is a smelte issue and not a svelte issue but I couldn't recreate it with vanilla svelte.

This should be fixed in 1.0.15.


get products api

Get all the products for shop

@Kratika0907 , can you link the API contracts here?


Feature request: ol/interaction/Select~Select without a selection style

I am currently trying to use a layer with a layer style (function) and a select interaction to handle all select logic. The problem I am having is that the select interaction forces a new select style on me.
I request that the select interaction optionally would not alter the style of any feature.
(I can not apply the same style to the select interaction since I have many layers with different styles)

The Select interaction puts all selected features on a separate layer, which has the Select interaction's style. If you do not want or need that, I'd recommend not using the Select interaction at all. A simple selection logic can be implemented with a few lines of code, using ol/Map~Map#getFeaturesAtPixel(). See http://openlayers.org/en/v5.0.3/examples/vector-tile-selection.html for inspiration.

Hi ahocevar I like to know how implement the simple selection logic but the link is broken. Can you show me how to achieve this goal?
Thanks a lot

Here is the current link: http://openlayers.org/en/latest/examples/vector-tile-selection.html

Thanks M393 but that implementation it not possible when you have more than 10.000 polygons in layer. The canvas  struggle when the all elements in layer try to render and the page go to a slow . The styled must be in a Vector Tile Layer nota Vector Layer.


fix(stop_line): fix stop_line state

Signed-off-by: k-obitsu<EMAIL_ADDRESS>Description

issues
The related issue is below.
https://github.com/autowarefoundation/autoware.universe/issues/1064

Causes
This problem is due to the fact that after passing the stop line in manual operation, State transitions to START, but cannot transition to APPROACH.

Measures
Therefore, I will take the following measures.
　・Added ros_parameter for stop_line state
　・Changed the condition of if statement constexpr param to ros_param

Functional level test method
Check the following using PSim.

A route with one stop line that automatically drives the vehicle.
　・After arriving at the goal, place the vehicle near the stop line. (using 2D pose estimate)
　・And after the above, place the vehicle at the start point, restart the vehicle.
　・Make sure to stop at the stop line.

A route with two stop line with an interval of 2m or more that automatically drives the vehicle.
　・After arriving at the goal, place the vehicle near the one of stop line. (using 2D pose estimate)
　・And after the above, place the vehicle at the start point, restart the vehicle.
　・Make sure to stop at the both of stop line.
In addition to the above, embed the debug code so that State can be confirmed on the terminal, and confirm that State transitions as expected.

Functional level test result
I confirmed that I passed the above.

Pre-review checklist for the PR author
The PR author must check the checkboxes below when creating the PR.

[x] I've confirmed the contribution guidelines.
[x] The PR follows the pull request guidelines.

In-review checklist for the PR reviewers
The PR reviewers must check the checkboxes below before approval.

[ ] The PR follows the pull request guidelines.

Post-review checklist for the PR author
The PR author must check the checkboxes below before merging.

[ ] There are no open discussions or they are tracked via tickets.

After all checkboxes are checked, anyone who has write access can merge the PR.

@k-obitsu
Please do the following:

Clarification of the problem.

Please link the issue behind this change to PR.

Functional level test method and presentation of results.

Please clarify what you confirmed after making this change and how to reproduce it.

Please see here for the detail.

@yukkysaito
Please make sure the Description.


monitoring: use config_template module for config

The alertmanager, grafana and prometheus configuration file are
generated with the template module which doesn't allow for using
config overrides.
Instead we could use the config_template plugin action and add a
new variable for overrides (one for each component).
With this patch, one should be able to add configuration to
prometheus with the following:
---
alertmanager_conf_overrides:
  global:
    smtp_smarthost: 'localhost:25'
...

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1902999
Signed-off-by: Dimitri Savineau<EMAIL_ADDRESS>

jenkins test centos-non_container-purge

jenkins test centos-non_container-purge

jenkins test centos-container-purge


Automations

Thanks again for the amazing updates.
I wanted to suggest a new section in the plugin setting, where the user could define automations that could be triggered either through the command palette or with a button in a dataview table.
The automation would be defined either with javascript or using the UI in the setting, for example (set property "text" to "something" and set property "date" to today and ... etc)

I think it would be in the scope of another plugin (maybe quickadd but i’m not familiar) that could leverage metadata menu api to change the fields values.


added functionality to delete tails file

added an endpoint to delete tails file on the basis of either cred_def_id or rev_reg_id

This PR resolves #2032

2 files are failing the black formatting checks (you can run black aries_cloudagent locally to fix)
unit tests are failing (run ./scripts/run_tests_indy locally to see the errors)


Signing function taking in an mbedtls_ecp_keypair instead of individual components

Suggested enhancement
ECDSA signing function (ref mbedtls_ecdsa_sign) which takes in an mbedtls_ecp_keypair instead of the individual components grp and d (which are private in the keypair structure).
Justification
Mbed TLS needs this because users are encouraged to store private keys in mbedtls_ecp_keypair structures, but using those structures to generate a signature currently requires explicit retrieval of private members.

I should've probably looked a bit further, seems this is covered by mbedtls_ecdsa_write_signature already.


Zone inference fails for "all requests" pattern from docs

The zone inference logic introduced in https://github.com/cloudflare/wrangler2/pull/545 fails to infer the zone from the example from the docs for "matching all routes":

A pattern to match all requests looks like this:
*example.com/*

Version
<EMAIL_ADDRESS>
Command
wrangler publish

Error
✘ [ERROR] Received a bad response from the API

  workers.api.error.zone_not_specified - Can't infer zone from route, please specify zone for
  "*example.com/*" [code: 10082]

Workaround
I was unable to make this work by specifying zone_id. This worked for me though...
Use the following config:
routes = ["*.example.com/*", "example.com/*"]

Good catch, I missed checking for patterns like this. I'll fix it. Thank you very much for filing this!

There are 2 workarounds here -

Use the patterns as you showed
add an optional zone_id like so: routes = [{pattern = "*example.com/*", zone_id ="<the zone id>"}] (we recently landed support for this.)
We should document this better, which we'll get to very soon.

Closing this issue, thanks for filing it!


Create a way to negate permissions

Create a way that permissions can be directly negated on a user or level. For instance, if a user is a member of the admin level, but for whatever reason is not allowed to perform one of the actions that the rest of the users in the admin level can perform, then you can specifically negate that permission on the user level.

Completed


Microsoft Defender for Office 365 Defender XDR workbook update

Microsoft Defender for Office 365 Detection and Insights workbook update
Required items, please complete
Change(s):

Full revamp of MDO workbook and name alignment with the MDE and MDI workbooks

Reason for Change(s):

Improving the template

Testing Completed:

Tested with Cx's

Checked that the validations are passing and have addressed any issues that are present:

Done

Hello @Justfyn, We already have MicrosoftDefenderForOffice365.json as standalone content.
So did you moved this workbook to Solution folder. In that case we would have to remove it from standalone folder so that we can package the solution.

No, that is a different workbook from what i see, on the soon to be removed solution of "Solutions/Microsoft Defender for Office 365".
Renamed the workbook "MicrosoftDefenderForOffice365detectionsandinsights.json"


Writing negative value to PLC register

Hello. First of all, awesome library! Everything works really good! I have situation where i need to write negative value in to PLC register, but library throw me an error when i try to write any kind of negative value ...
throw new Error(util.format(
^
Error: Register value must be a number between 0 and 65535.
If i'm right, 0 to 65535, this is uint16 type. But i need to write int16 (-32,768 to 32,768)
Any suggestion how to solve this kind of situation?

Judging from the error message, you're using the old version and it expects the register value to be uint16: https://github.com/morkai/h5.modbus/blob/v0/lib/functions/util.js#L95
You can use the Buffer.writeInt16BE() and Buffer.readUInt16BE() to convert it to uint or, if the value is less than 0, add 0x10000 to it (that's what is done automatically in the new version).

It works, thank you very much.

One more question ... Can you tell me what is number of registers which can
be read with one readHoldingRegisters request?
Best regards, Tomaž
2016-05-18 16:23 GMT+02:00 Łukasz Walukiewicz<EMAIL_ADDRESS>
Judging from the error message, you're using the old version and it
expects the register value to be uint16:
https://github.com/morkai/h5.modbus/blob/v0/lib/functions/util.js#L95
You can use the Buffer.writeInt16BE() and Buffer.readUInt16BE() to
convert it to uint or, if the value is less than 0, add 0x10000 to it
(that's what is done automatically in the new version
https://github.com/morkai/h5.modbus/blob/8eb063d6f00a07ba9b20076f037ed4cf1eea1d66/lib/helpers.js#L161
).
—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/morkai/h5.modbus/issues/9#issuecomment-220041859

--
Lep pozdrav, Tomaž Rems
Izdelava spletnih strani, spletno in grafično oblikovanje
www.tomaz-rems.si http://www.tomaz-rems.si

125 (as per spec), but various devices might have different, lower limits.

Thank you. Have a nice day.
2016-05-19 11:12 GMT+02:00 Łukasz Walukiewicz<EMAIL_ADDRESS>
125 (as per spec
http://www.modbus.org/docs/Modbus_Application_Protocol_V1_1b.pdf), but
various devices might have different, lower limits.
—
You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub
https://github.com/morkai/h5.modbus/issues/9#issuecomment-220269729

--
Lep pozdrav, Tomaž Rems
Izdelava spletnih strani, spletno in grafično oblikovanje
www.tomaz-rems.si http://www.tomaz-rems.si

Sorry for bothering you again but i must ask... is there any existing
example of serial rtu master or at least full rtu connection part for your
lib?
Sunny regards from Slovenia.
2016-05-19 11:31 GMT+02:00 Tomaž Rems<EMAIL_ADDRESS>
Thank you. Have a nice day.
2016-05-19 11:12 GMT+02:00 Łukasz Walukiewicz<EMAIL_ADDRESS>
125 (as per spec
http://www.modbus.org/docs/Modbus_Application_Protocol_V1_1b.pdf), but
various devices might have different, lower limits.
—
You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub
https://github.com/morkai/h5.modbus/issues/9#issuecomment-220269729

--
Lep pozdrav, Tomaž Rems
Izdelava spletnih strani, spletno in grafično oblikovanje
www.tomaz-rems.si http://www.tomaz-rems.si

--
Lep pozdrav, Tomaž Rems
Izdelava spletnih strani, spletno in grafično oblikovanje
www.tomaz-rems.si http://www.tomaz-rems.si

... i forgot to tell you... for last version
2016-06-05 16:25 GMT+02:00 Tomaž Rems<EMAIL_ADDRESS>
Sorry for bothering you again but i must ask... is there any existing
example of serial rtu master or at least full rtu connection part for your
lib?
Sunny regards from Slovenia.
2016-05-19 11:31 GMT+02:00 Tomaž Rems<EMAIL_ADDRESS>
Thank you. Have a nice day.
2016-05-19 11:12 GMT+02:00 Łukasz Walukiewicz<EMAIL_ADDRESS>
125 (as per spec
http://www.modbus.org/docs/Modbus_Application_Protocol_V1_1b.pdf),
but various devices might have different, lower limits.
—
You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub
https://github.com/morkai/h5.modbus/issues/9#issuecomment-220269729

--
Lep pozdrav, Tomaž Rems
Izdelava spletnih strani, spletno in grafično oblikovanje
www.tomaz-rems.si http://www.tomaz-rems.si

--
Lep pozdrav, Tomaž Rems
Izdelava spletnih strani, spletno in grafično oblikovanje
www.tomaz-rems.si http://www.tomaz-rems.si

--
Lep pozdrav, Tomaž Rems
Izdelava spletnih strani, spletno in grafično oblikovanje
www.tomaz-rems.si http://www.tomaz-rems.si

var master = modbus.createMaster({
  transport: {
    type: 'rtu',
    // End of frame timeout.
    eofTimeout: 50
  },
  connection: {
    type: 'serial',
    // Whether to automatically open the serial port in the constructor.
    // If false, one must manually call the `open()` method.
    autoOpen: true,
    // Whether to call the `close()` method on the underlying SerialPort
    // when the connection is destroyed.
    closeOnDestroy: true,
    // Whether to attach an empty listener for the `error` events after
    // the connection is destroyed, so the possible stray error events
    // don't crash the process.
    suppressErrorsAfterDestroy: true,
    // Optional instance of SerialPort from the serialport npm package.
    serialPort: serialPort,
    // Optional options passed to a dynamically created instance of SerialPort
    // from the serialport npm package.
    serialPortOptions: {
      baudRate: 9600,
      dataBits: 8,
      stopBits: 1,
      parity: 'even'
    }
  }
});

For all serialPortOptions see the serialport package docs.

Thank you very much it is working.
2016-06-05 16:49 GMT+02:00 Łukasz Walukiewicz<EMAIL_ADDRESS>
var master = modbus.createMaster({
transport: {
type: 'rtu',
// End of frame timeout.
eofTimeout: 50
},
connection: {
type: 'serial',
// Whether to automatically open the serial port in the constructor.
// If false, one must manually call the open() method.
autoOpen: true,
// Whether to call the close() method on the underlying SerialPort
// when the connection is destroyed.
closeOnDestroy: true,
// Whether to attach an empty listener for the error events after
// the connection is destroyed, so the possible stray error events
// don't crash the process.
suppressErrorsAfterDestroy: true,
// Optional instance of SerialPort from the serialport npm package.
serialPort: serialPort,
// Optional options passed to a dynamically created instance of SerialPort
// from the serialport npm package.
serialPortOptions: {
baudRate: 9600,
dataBits: 8,
stopBits: 1,
parity: 'even'
}
}
});
For all serialPortOptions see the serialport package docs
https://github.com/EmergingTechnologyAdvisors/node-serialport/blob/3.1.2/README.md#serialport-path-options-openimmediately-callback
.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/morkai/h5.modbus/issues/9#issuecomment-223817206, or mute
the thread
https://github.com/notifications/unsubscribe/AQLJ1bx6I2h9HJk1IG9SINHYSEdIHJjvks5qIuHngaJpZM4IhUoW
.

--
Lep pozdrav, Tomaž Rems
Izdelava spletnih strani, spletno in grafično oblikovanje
www.tomaz-rems.si http://www.tomaz-rems.si

AAaaa, not completely ...
Master is conneced and sending request ...but no matter what i do, there
always is negative response "No response was received from the slave in the
specified time."
For start i would like to read for example reg on address 606 with function
readholdingregisters which is number 5 if i understand right and with
quantity 1 ...
My current confguration based on your example:
var serialPort = new SerialPort('/dev/ttyUSB0', {});
var master = modbus.createMaster({
transport: {
type: 'rtu',
eofTimeout: 10,
},
connection: {
type: 'serial',
autoOpen: true,
closeOnDestroy: true,
serialPort: serialPort,
serialPortOptions: {baudRate: 9600, dataBits: 8, parity: 'none',
stopBits: 1, flowControl: ['RTSCTS']}
},
maxConcurrentTransactions: 1,
defaultTimeout: 1200,
defaultUnit: 2,
defaultMaxRetries: 0,
});
...................................calling startTransaction for n
times...............................................
function startTransaction(id, reg, functionCode, quantity, interval){
var t = master.execute({
id: id, // i number from looping
request: {
functionCode: functionCode, // 5
address: reg, // 606
quantity: quantity, // 1
},
interval: interval // 0
});
t.on('error', onError);
t.on('request', onRequest);
t.on('response', onResponse);
}
*My configuration with previous library (which worked ok) was:*var
serialPort = new SerialPort('/dev/ttyUSB0', { baudRate: 9600, dataBits: 8,
parity: 'none', stopBits: 1, flowControl: ['RTSCTS'], });
var modbus_options = {
transport: { type: 'rtu', eofTimeout: 50,  connection: { type: 'serial',
serialPort: serialPort}  },
suppressTransactionErrors: true,
retryOnException: true,
maxConcurrentRequests: 1,
defaultUnit: 2,
defaultMaxRetries: 1,
defaultTimeout: 1100
}
var master = modbus.createMaster(modbus_options);
...............................calling loopBus for n
times................................
function loopBus(){
var loopModbus = master.readHoldingRegisters(reg, n, {maxRetries:
2,timeout: loopDelay});
loopModbus.on('response', function(response){..}
}
Any suggestions? Can you tell me in short if there was any major changes on
RTU side of the library?
2016-06-06 1:08 GMT+02:00 Tomaž Rems<EMAIL_ADDRESS>
Thank you very much it is working.
2016-06-05 16:49 GMT+02:00 Łukasz Walukiewicz<EMAIL_ADDRESS>
var master = modbus.createMaster({
transport: {
type: 'rtu',
// End of frame timeout.
eofTimeout: 50
},
connection: {
type: 'serial',
// Whether to automatically open the serial port in the constructor.
// If false, one must manually call the open() method.
autoOpen: true,
// Whether to call the close() method on the underlying SerialPort
// when the connection is destroyed.
closeOnDestroy: true,
// Whether to attach an empty listener for the error events after
// the connection is destroyed, so the possible stray error events
// don't crash the process.
suppressErrorsAfterDestroy: true,
// Optional instance of SerialPort from the serialport npm package.
serialPort: serialPort,
// Optional options passed to a dynamically created instance of SerialPort
// from the serialport npm package.
serialPortOptions: {
baudRate: 9600,
dataBits: 8,
stopBits: 1,
parity: 'even'
}
}
});
For all serialPortOptions see the serialport package docs
https://github.com/EmergingTechnologyAdvisors/node-serialport/blob/3.1.2/README.md#serialport-path-options-openimmediately-callback
.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/morkai/h5.modbus/issues/9#issuecomment-223817206,
or mute the thread
https://github.com/notifications/unsubscribe/AQLJ1bx6I2h9HJk1IG9SINHYSEdIHJjvks5qIuHngaJpZM4IhUoW
.

--
Lep pozdrav, Tomaž Rems
Izdelava spletnih strani, spletno in grafično oblikovanje
www.tomaz-rems.si http://www.tomaz-rems.si

--
Lep pozdrav, Tomaž Rems
Izdelava spletnih strani, spletno in grafično oblikovanje
www.tomaz-rems.si http://www.tomaz-rems.si

If you're going to specify connection.serialPort option then the connection.serialPortOptions is ignored (you should use serialPort OR serialPortOptions - if you're using serialPort then stick the serialPortOptions to new SerialPort()).
You can always listen for write and data events on the connection to see what is being sent and received:
master.connection.on('write', b => console.log('TX:', b));
master.connection.on('data', b => console.log('RX:', b));

still no response ...
..........................
[master] opened
0: No response was received from the slave in the specified time.
[tx] <Buffer 02 05 02 5d 00 00 5d 93>
1: No response was received from the slave in the specified time.
[tx] <Buffer 02 05 02 5d 00 00 5d 93>
2: No response was received from the slave in the specified time.
[tx] <Buffer 02 05 02 5d 00 00 5d 93>
.........................
I think that the problem is in serialport (2.14.7) version or maybe just
configurations .... there is no modbus rx neither serialport.on('data')
response ... but i don't want to upgrade serialport to see what will
happen, because i could jeopardize previous working version :S
2016-06-06 19:05 GMT+02:00 Łukasz Walukiewicz<EMAIL_ADDRESS>
If you're going to specify connection.serialPort option then the
connection.serialPortOptions is ignored (you should use serialPort OR
serialPortOptions - if you're using serialPort then stick the
serialPortOptions to new SerialPort()).
You can always listen for write and data events on the connection to see
what is being sent and received:
master.connection.on('write', b => console.log('TX:', b));master.connection.on('data', b => console.log('RX:', b));
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/morkai/h5.modbus/issues/9#issuecomment-224022028, or mute
the thread
https://github.com/notifications/unsubscribe/AQLJ1edA46O34sGvIDEDFotX3RTGsPf-ks5qJFN0gaJpZM4IhUoW
.

--
Lep pozdrav, Tomaž Rems
Izdelava spletnih strani, spletno in grafično oblikovanje
www.tomaz-rems.si http://www.tomaz-rems.si

If there are no data events then the cable is not properly connected or the device doesn't understand the request, i.e. wrong serial port options.
There is no version 2.14.7 of the serialport package (npm view serialport versions).
Does it work with the previous version of h5.modbus?
Did you try the simplest possible test case?
var SerialPort = require('serialport');

var serialPort = new SerialPort('/dev/ttyUSB0', {
  baudRate: 9600,
  dataBits: 8,
  stopBits: 1,
  parity: 'none'
});

serialPort.on('data', function(d) { console.log('RX:', d); });

serialPort.on('error', function(err) { console.error(err.message); });

serialPort.on('open', function()
{
  var frame = new Buffer([
    0x02, // Unit
    0x05, // Function code (write single coil)
    0x02, 0x5d, // Coil address
    0x00, 0x00, // Coil state (OFF)
    0x5d, 0x93 // Checksum
  ]);

  console.log('TX:', frame);

  serialPort.write(frame);
});

Test successful... rx is here ...
TX: <Buffer 02 03 02 5d 00 00 5d 93>
RX: <Buffer 02 83 08 b0 f6>

var SerialPort = require('serialport').SerialPort;;
var serialPort = new SerialPort('/dev/ttyUSB0', {
baudRate: 9600,
dataBits: 8,
stopBits: 1,
parity: 'none',
flowControl: ['RTSCTS']
});
serialPort.on('data', function(d) { console.log('RX:', d); });
serialPort.on('error', function(err) { console.error(err.message); });
serialPort.on('open', function(){
var frame = new Buffer([
0x02, // Unit
0x03, // Function code (read holding registers)
0x02, 0x5d, // reg address
0x00, 0x00, // count
0x5d, 0x93 // Checksum
]);
console.log('TX:', frame);
serialPort.write(frame);
});
2016-06-06 20:34 GMT+02:00 Łukasz Walukiewicz<EMAIL_ADDRESS>
If there are no data events then the cable is not properly connected or
the device doesn't understand the request, i.e. wrong serial port options.
There is no version 2.14.7 of the serialport package (npm view serialport
versions).
Does it work with the previous version of h5.modbus?
Did you try the simplest possible test case?
var SerialPort = require('serialport');
var serialPort = new SerialPort('/dev/ttyUSB0', {
baudRate: 9600,
dataBits: 8,
stopBits: 1,
parity: 'none'
});
serialPort.on('data', function(d) { console.log('RX:', d); });
serialPort.on('error', function(err) { console.error(err.message); });
serialPort.on('open', function()
{
var frame = new Buffer([
0x02, // Unit
0x05, // Function code (write single coil)
0x02, 0x5d, // Coil address
0x00, 0x00, // Coil state (OFF)
0x5d, 0x93 // Checksum
]);
console.log('TX:', frame);
serialPort.write(frame);
});
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/morkai/h5.modbus/issues/9#issuecomment-224047494, or mute
the thread
https://github.com/notifications/unsubscribe/AQLJ1Sry75wzzCAGdUXj4_nx6MjzTnGsks5qJGg2gaJpZM4IhUoW
.

--
Lep pozdrav, Tomaž Rems
Izdelava spletnih strani, spletno in grafično oblikovanje
www.tomaz-rems.si http://www.tomaz-rems.si

Then try using the same serial port settings with h5.modbus:
var modbus = require('h5.modbus');

var master = modbus.createMaster({
  transport: {
    type: 'rtu',
    eofTimeout: 50 // Lower might work too
  },
  connection: {
    type: 'serial',
    serialPortOptions: {
      baudRate: 9600,
      dataBits: 8,
      stopBits: 1,
      parity: 'none'
    }
  },
  defaultUnit: 2,
  defaultTimeout: 1000,
  defaultMaxRetries: 0
});

master.once('open', function()
{
  var t = master.writeSingleCoil(605, false);

  t.on('error', function(err)
  {
    console.error('ERR: %s', err.message);
  });

  t.on('request', function(requestId)
  {
    console.log('REQ %d: %s', requestId, this.request);
  });

  t.on('response', function(res)
  {
    console.log(res.toString());
  });
});

Also, you wrote that the functionCode passed to the startTransaction() is 5, which is WRITE single coil, but you're passing quantity (that request expects state and if it's not present then OFF is assumed (because state === undefined and then !!state === false).


Add course field to consult

Lets the user know which course the consult is for. Course becomes a compulsory field for a consult

If time had allowed, this would've been worth considering putting on Lessons instead, but seeing the work necessary (need to adapt the code to lessons, modify storage, test cases, maybe even check a student is taking a course before adding them to a lesson of that course), I think we can just not do this.


Improve unicode atom support

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).
SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

Merging after short telegram discussion, collected Paul's feedback on #1060.


RSQL query to filter on value in nested list

Hi, is it possible to write RSQL queries that filter on values in nested lists?
For example, the following object is taken from the readme but with 'address' changed to a list of addresses:
{
      "addresses": [
        {
          "city": "Port Lenorefort",
          "street": "18304 Casper Trail",
          "country": "Palestinian Territory",
          "zipcode": "22270"
        },
        {
          "city": "Indianapolis",
          "street": "50 Kings Road",
          "country": "USA",
          "zipcode": "11111"
        }
      ],
      "birth_date": "2003-08-02T21:25:27.3902975+02:00",
      "company": "Hilll LLC",
      "email"<EMAIL_ADDRESS>      "id": 1,
      "name": "West",
      "phone": "957.379.6587",
      "username": "Amalia.Stroman8",
      "website": "https://lou.name",
      "debit": 0.171063486566331,
      "credit": 0.5955531883964097
}

How would I write a query that returns objects that contain an address with city equal to Indianapolis?
For example, https://localhost:5003/customers?query=addresses.city==Indianapolis does not work.
Is there any way to do it?
Thanks :)

Actually it’s not possibleEnvoyé de mon iPhoneLe 5 juil. 2023 à 14:08, madben2000 @.***> a écrit :
Is it possible or not?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>


Better handling of comma seperated list

Comma separated list of ids might have space(s) in certain cases (e.g if prepared with Group By step).  Since this splits strictly with comma, it cannot find following ids. This patch allows handling of spaces properly.

This method can be improved much more this. I will send another PR soon.


Rate limit policy does not take into account changes in the config when using Redis

The rate limit policy has some limitations when configured to use Redis.
For example:

Create a fixed window limit for a key, with a given count and window.
Restart the gateway with the same config, just changing the window.
The policy ignores the change and will not adapt the TTL of the limiting keys to the new window.

or

Start Apicast with a limit in the config.
Restart the gateway without that limit.
Add the same limit again and restart the gateway.
Apicast will apply limits using the keys created in the first step. That means that for example, the count and the ttl are not reset.

In order to solve this problems, we need to store more information in Redis and perform some checks every time Apicast boots with the rate limit policy config. For example, the policy needs to check the existing limits and see if it needs to increase the TTL of the limiting keys, decrease it, remove them, etc.

If it's acceptable to reset rate limits when the gateway restarts, we can add timestamp or a random string to the key in the initialization.

@y-tabata I think it will depend a lot on the use case.
For limits with small periods (seconds, minutes) it might be acceptable. However, 3scale supports big periods for limits (like a month, or a year). In that case, resetting the counters and the limiters is not acceptable.

Regarding connections and leaky bucket, it's no problem to reset rate limits because when the gateway restarts, there is no connection.
So we need to focus on fixed window only.
There are 5 cases on each parameter as illustrated in the following example.
window:

old window
current
new window
expected window
reset?

10
5
3
3
yes

10
5
5
5
yes

10
5
7
7
yes

10
5
10
5
no

10
5
15
15
yes

count:

old count
current
new count
expected count
reset?

10
5
3
3
yes

10
5
5
5
yes

10
5
7
7
yes

10
5
10
5
no

10
5
15
15
yes

Regarding window, if the new window is shorter than the current window, we have to reset the rate limit.
If the new window is longer than the current window and the window value is changed, it is thought that users restarted the gateway in order to reset the rate limit. It is strange that the window in the real environment is still following to the current window although users change the window value. So we have to reset the rate limit.
But if the new window equals the old window,  it is not thought that users restarted the gateway in order to reset the rate limit. So we don't reset the rate limit.
The same is true of count.
So we store the count and window in Redis, and if the new window equals the old window and the new count equals the old count, then we don't reset rate limits. Otherwise, we reset rate limits.

@y-tabata you are thinking that the key is going to be known without the request.
That is not going to be the case all the time. We plan to add templating to the key, so you can for example rate limit by {{ ngx.var.remote_addr }} to use client IP address. That value would be interpolated in the rewrite phase - the key would not be known until the evaluation.
I think it is first important to define what we want - business logic wise - and then proceed to the technical solution.
"connection"
https://github.com/openresty/lua-resty-limit-traffic/blob/ef080731b80fe00a385a4aed8a7f7f575d01c152/lib/resty/limit/count.lua#L47 uses decrements to maintain the connection limit. That means on change of the limit the current window would first have to expire.
I understand this might be confusing and probably counter effective.
Example scenario: the limit is set too high for too long window and due to an attack it needs to be lowered - need to expire the window would be pretty limiting factor preventing quick reaction to an attack.
Proposal: use increments instead of decrements to maintain current connection count and apply the limit after that.
"leaky bucket"
This limiter is configured with per second rate limit and burst. I think it is ok to ignore this as its super low granularity would cause it to reload instantly.
"fixed window"
https://github.com/openresty/lua-resty-limit-traffic/blob/ef080731b80fe00a385a4aed8a7f7f575d01c152/lib/resty/limit/count.lua#L47 - it is implemented the same as connection rate limiter. Decrements from the limit default value.
Switching to maintaining current value and let the limit outside would solve the problem.
Summary
I think we should investigate cost of changing to increment model and see if we can push those changes upstream. If not, we could simply fork the library.
Also, there is already some discussion about changing limits on the fly: https://github.com/openresty/lua-resty-limit-traffic/issues/23

@mikz Thank you for your advice.

so you can for example rate limit by {{ ngx.var.remote_addr }} to use client IP address.

If we use client IP address, the scope will be client. It's good templating when we will implement the client scope in this policy in the future, but considering the service or the global scope, we'd like to use other templating.

"connection"
https://github.com/openresty/lua-resty-limit-traffic/blob/ef080731b80fe00a385a4aed8a7f7f575d01c152/lib/resty/limit/count.lua#L47 uses decrements to maintain the connection limit. That means on change of the limit the current window would first have to expire.

The link is "fixed window"'s link. I think "connection" is the increment model.

I think we should investigate cost of changing to increment model and see if we can push those changes upstream. If not, we could simply fork the library.
Also, there is already some discussion about changing limits on the fly: openresty/lua-resty-limit-traffic#23

In my understanding, if a user changes parameters of a policy (from UI), apicast restarts and the init and the init_worker phases are executed. Is my understanding correct? If so, we don't need to consider changing limits on the fly.
One thing we have to consider is when a user changes parameters of the "fixed window" limiter, we should reset the remaining or not. #703 resets it but you think it's not acceptable to reset it, don't you?
The issue (openresty/lua-resty-limit-traffic#23) looks not active.
How about using the library, leaving it as decrement model?
For example, when the count is changed 10 to 20, we increment the (remaining) value by 10. When the window is changed 3000 to 2000, we decrement the expiration by 1000.

@mikz

And now imagine scenario when you want to combine those into for example rate limiting path per client ip: {{ ngx.var.remote_addr }}/{{ ngx.var.uri }}. The nginx examples work on the same principal. The rate limiting key is known only when the request arrives because it is using variables like $remote_addr.

I understand. So users can rate limit by "client" or "method" and so on.
In order to do that, we have to add the rewrite method to interpolate the templatings and add the list of templatings to the json schema (key { name }) or define some rule to use templatings, for example, put the templating string in double brackets. {{ ngx.var.remote_addr }}

Unfortunately no. init and init_worker are executed only when APIcast starts/restarts. When it reloads configuration they are not executed (because it does not restart).

I understand. So in the access method, we have to check whether configuration was changed or not, and call on the fly method like set_conn.
Regarding connection, set_delay is insufficient.
Regarding fixed window, there are no on the fly methods.
We should add these methods to lua-resty-limit.

One of the nice benefits would be that you can have two gateways with different limits using the same key. Maybe for internal/external network.

This is very nice benefit, I think.

I'll try to revive openresty/lua-resty-limit-traffic#23 and see if they'd be ok with switching to increment model. IMHO that is the best path forward and would unify how the rate limiters are implemented.

Thanks for your help.

@y-tabata

I understand. So users can rate limit by "client" or "method" and so on.
In order to do that, we have to add the rewrite method to interpolate the templatings and add the list of templatings to the json schema (key { name }) or define some rule to use templatings, for example, put the templating string in double brackets. {{ ngx.var.remote_addr }}

Yes, the template expansion would be performed in the rewrite phase. And as for how to template, the plan is to use liquid - the same format 3scale uses on developer portal and for nginx configuration of APIcast. I plan to work on this and have a prototype by the end of this week.

I understand. So in the access method, we have to check whether configuration was changed or not, and call on the fly method like set_conn.
Regarding connection, set_delay is insufficient.
Regarding fixed window, there are no on the fly methods.
We should add these methods to lua-resty-limit.

I think we might not be needing that. If both connection and fixed window rate limiters would use increments, then the only other variables are the limit and the time window.
I think we should be encoding the time window to the key itself. So for example for UNIX timestamp<PHONE_NUMBER> and time window 3600 we would round it to<PHONE_NUMBER> and use it as part of the key:<PHONE_NUMBER>_{{ngx.var.remote_addr}}. Then changing the time window would also change the key and we would not have to worry about changing expiration.  This could be done by another interpolation or by some flag in the configuration, or by scope.
I'd really try to stick just using increments, so we don't have to solve the hard problem of synchronizing changes across the fleet of APIcast instances.

I made a simple patch https://github.com/openresty/lua-resty-limit-traffic/pull/34 to change it to increments. I'd appreciate some review scrutiny especially regarding atomicity and race conditions.

https://github.com/3scale/apicast/pull/758 updates APIcast to use that forked version.

Can we close this by #703?

Closed by https://github.com/3scale/apicast/pull/703 and https://github.com/3scale/apicast/pull/758


Prevent pistons moving blocks into regions

fixes #715
it also prevents blocks being retracted into void regions, and should pretty much fix all issues regarding pistons and regions
(tested in GDIII and blocks don't get pushed out of the map into the void)

Works as intended for me, I haven't noticed any bugs.

merged


[BUG] Doesn't recognize the tuning/pitch.

When I was doing my index conversion of a song it works well until I realized that the pitch -12 wasn't applied to the final product.
Uploading recording.webm…
I was using Crepe with hop-length 128.

Uploading recording.webm… Can you upload it?

This issue is being closed due to inactivity. If you still encounter this problem or have additional information, please feel free to reopen the issue.


Redirecting pages by alternate means to YAML frontmatter.

I am currently using PicoRedirect plugin in order to redirect pages. This requires adding the Redirect:  header in the YAML frontmatter of each page. However, in situations where you need to redirect every page in a directory, this is indeed a task. Do we have an alternate way to redirect all pages in a particular directory to another path?

If I am to use the Rewrite rule, what is the url format I should use?
https://example.com/content/page-name.md or https://example.com/page-name?
The official documentation uses the absolute url with the extension, which I believe does not exist in Pico.

It's been awhile since I've done any web server configuration myself, so I don't know what the proper config would look like off the top of my head.
But what you're going to be looking to do is use a RegExp-style string to match and replace a particular part of the URL.
So, for example, it would be like, rewrite all example.com/blog/* to example.com/news/*.
(The asterisk there is just to illustrate the point. That's not necessarily how it will be written.)
You're rewriting the URL from the perspective of the end user though, so it would be example.com/page-name in that case.  You're not telling Pico to look for a different content file, you're just redirecting the user to a new URL before they get to Pico.
I can do a little digging for you if you'd like.  Just let me know what web server you're using and give me an example of what URLs you're trying to rewrite to what. 😉

You're rewriting the URL from the perspective of the end user though, so it would be example.com/page-name in that case. You're not telling Pico to look for a different content file, you're just redirecting the user to a new URL before they get to Pico.

This is what I wanted to confirm. Thank you.
So, here's what I have done so far. In my local machine, I edited my /etc/apache2/apache2.conf file and added
RewriteEngine On
RewriteRule "^project_folder/blog/(.*)" "project_folder/new/$1"  [R]

inside
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
RewriteEngine On
RewriteRule "^project_folder/blog/(.*)" "project_folder/new/$1"  [R]
</Directory>

Restarted Apache2 service but the redirection didn't work. I tried changing the url to a full web url as RewriteRule "^http://localhost/project_folder/blog/(.*)" "http://localhost/project_folder/new/$1" but it didn't work either.
What am I doing wrong?

@PhrozenByte, do you have any input on this?  I don't have an Apache test environment set up at the moment, and I'm not that familiar with Apache configuration these days anyway.
As far as I can tell, the rewrite rule looks good.  An online tester I found even confirms that it should result in the desired rewrite, so I'd have to assume the issue is something else configuration related. 🤔
One possibility I could see is that Pico's .htaccess rules are flagged [L] or "Last", so that once they're applied, no further rewrites occur.  As far as I can tell, Apache applies Rewrite Rules starting from the deepest directory and working its way up.  This might mean that the rules in .htaccess are making it so that the new rule in apache2.conf just isn't being used.
@notakoder, this is purely speculation on my part, but it might be worth a quick test.  🤷🏻♀
You could try either removing the [L]'s, or putting your own rule above it in Pico's .htaccess to see if that makes any difference.

@mayamcdougall My .htaccess does not have any redirection set in it because I am told that Pico does not have real page links but only vitrual page links. example.com/folder/page really is example.com/content/folder/page. Moreover, I think that only the rules are overwritten by the 'highest priority' config file, not the file itself. So, everything inside the apache.conf file that is not overwritten by .htaccess must be honoured. Again, this is just my common sense talking. I could be wrong.
Anyway, here is my .htaccess file.
<IfModule mod_rewrite.c>
    RewriteEngine On
    # May be required to access sub directories
    #RewriteBase /

    # Deny access to internal dirs and files by passing the URL to Pico
    RewriteRule ^(config|content|vendor|CHANGELOG\.md|composer\.(json|lock|phar))(/|$) index.php [L]
    RewriteRule (^\.|/\.)(?!well-known(/|$)) index.php [L]

    # Enable URL rewriting
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^ index.php [L]

    <IfModule mod_env.c>
        # Let Pico know about available URL rewriting
        SetEnv PICO_URL_REWRITING 1
    </IfModule>
</IfModule>

# Prevent file browsing
Options -Indexes -MultiViews

# Redirect to non-www
RewriteCond %{HTTP_HOST} ^www\.(.+\.[^\.]+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]

Alright, so, again, I have to preface this by saying I'm not that knowledgeable about Apache config.  I haven't tested anything, I'm just going off of what I've read.
What I'm saying is not that .htaccess is overriding your apache2.conf, simply that its RewriteRules are being applied first.  Under normal circumstances, it would then go through and apply any rewrites in your apache2.conf, however, the [L] sounds like it tells Apache, "If we match and rewrite based on this rule, don't read any further RewriteRules for this url, we're done."
Since Pico's included RewriteRules try to rewrite just about everything to either 404 or index.php, I'm wondering if that's what's interfering.  It's already been matched once, and the [L] told it not to try anymore.
For testing, does it make a difference adding your own rule to .htaccess just above Pico's?
RewriteRule "^project_folder/blog/(.*)" "project_folder/new/$1"  [R]

# Deny access to internal dirs and files by passing the URL to Pico
RewriteRule ^(config|content|vendor|CHANGELOG\.md|composer\.(json|lock|phar))(/|$) index.php [L]
RewriteRule (^\.|/\.)(?!well-known(/|$)) index.php [L]

Oh, that's what you meant. Your speculation seems correct despite what you say about your knowledge on Apache. :smile:
Thanks for helping.
I tested what you suggested, but there is no redirection. I even tried with the proper page name instead of regex.
RewriteRule "^project_folder/blog/page" "project_folder/new/page"  [R]
RewriteRule "^project_folder/blog/(.*)" "project_folder/new/$1"  [R]
RewriteRule "^http://localhost/project_folder/blog/(.*)" "http://localhost/project_folder/new/$1"  [R]

So, I guess, I'll wait for any responses to this issue.

That's too bad. I've got no idea then. 🤷🏻♀
I was really hoping that would fix it.
Short of spinning up my own Apache install and seeing if I can recreate the situation (and stumble upon a solution), I don't have any other answers on this. 😓
@PhrozenByte If you've got any input on this one it'd be appreciated, thanks. 😁😅
(I'm sure it's probably something stupid we both missed. 😜)

That's alright. You've tried. Been helpful. Let's see if PhrozenByte has any suggestions.

Unfortunately I can't provide webserver support, just some quick notes: The first argument to RewriteRule is a regex matching a relative path, no URL. Rules are evaluated in order, i.e. if you want to create a redirection rule (option [R]), you usually want it to be evaluated first and stop evaluation afterwards (i.e. it should be [R,L]). Remember to restart Apache if you're modifying apache2.conf and don't forget to actually enable the rewrite engine (i.e. RewriteEngine on).

The first argument to RewriteRule is a regex matching a relative

Okay, I wasn't even thinking about that.
So, assuming project_folder is your Pico folder, I probably should have actually had you test something like:
RewriteRule "^blog/(.*)" "new/$1"  [R]

# Deny access to internal dirs and files by passing the URL to Pico
RewriteRule ^(config|content|vendor|CHANGELOG\.md|composer\.(json|lock|phar))(/|$) index.php [L]
RewriteRule (^\.|/\.)(?!well-known(/|$)) index.php [L]

@PhrozenByte This is of course presuming I was actually even on the right track.  Do you think that Apache matching an [L] rule in .htaccess would prevent it from matching @notakoder's new rule in apache2.conf altogether?  I have no idea if I'm interpreting Apache's behavior right, I'm just trying to draw conclusions from random guides and documentation. 😓
Also, presumably we wouldn't want to use both [R,L] for this one, because in the end it still needs to be rewritten to index.php in the end?

apache2.conf is interpreted before any .htaccess file. R yields a HTTP redirect, i.e. the browser is redirected to said page and sends another request then. So no, if you do use R, you usually also want to use L, otherwise any later RewriteRule might overrule the redirection again (i.e. no redirection happens).

apache2.conf is interpreted before any .htaccess file.

Yeah, that's what I would have though.  All I could find was that RewriteRule's are applied from the "bottom up", starting from the deepest directory.  Nothing on whether they actually got applied before apache2.conf or not.

R yields a HTTP redirect, i.e. the browser is redirected to said page and sends another request then.

Right, and then the matching process starts over, essentially, with a new request. 🤦🏻♀
I had realized that somewhere before now, but then I forgot somewhere in the troubleshooting. 😓
I've had this quiet thought in the back of my head for the whole thread, trying to point out the obvious difference between a rewrite and a redirect, but I couldn't quite remember what it was. 😅
Alright, thanks for the refresher, I'll keep at it with @notakoder and see if we can get if solved for them.

@notakoder It seems like .htaccess shouldn't be causing any issue, so go ahead and revert that to its original form.
Going back to apache2.conf, let's try adding both flags, [R,L], just in case.  Double check that you've got the relative path correct in your RegEx (it seems like you do based on the other URL examples you provided, but still).
Make sure you've got mod_rewrite enabled as well.  Do your Pico page URLs rewrite correctly or do they have question marks in them (eg http://localhost/project_folder/?blog/post)?
Maybe there's some clues in your apache logs?  You can usually "follow" them with tail -f file.log on the relevant log file (afaik, Apache logs are configured differently on different distros, webhosts, etc., so the actual file and whether it's logging anything that'll help here would vary).

Okay, so I'm 99% sure this is going to be the answer.
Now that I remember how Apache works... *drumroll*
Remove all your changes from apache2.conf and don't touch it again. 🤦🏻♀
Go into /etc/apache2/sites-available and find your relevant site config.  If you haven't changed this, it's probably called something like 000-default.conf.
Put your RewriteRule there. 🤦🏻♀🤦🏻♀
Breathe a sign of relief, then cry in the corner with me for forgetting how Apache is usually configured. 😭
(I'm probably being too dramatic, which is going to jinx this. 👆🏻)
But I'm hopeful this time it's really going to be the fix.  It took me FAR too long messing with apache2.conf before I realized... I don't think I've ever had to touch it before!
All my sites were always configured using the sites-available and sites-enabled (symlinks of sites-available) config folders.  Even in Nginx, oddly enough, this paradigm is often used for site-level config.
So... yeah.
The Rewrites belong in your VirtualHost directive, NOT in the Directory directive. 😤
(Please let this be it. 🤞🏻😩)

(Please let this be it. 🤞🏻weary)

I think that is it. :smile: Moving the lines to 000-default-conf worked in my system. However, I had trouble getting the correct path in the server since the document roots was /var/www/html instead of /var/www as in my system. Anyway, I figured out that I could do the same in my .htaccess file instead of Apache configuration and this had the advantage of portability of redirects inside the source code itself.
So, this is what I tried in my .htaccess file
RewriteRule "^old-folder/(.*)" "http://localhost/project-folder/new-folder/$1"  [R=301,L]
and this works. But I am using a URL as the destination and this creates issues in the server since the folder names are different. I've been trying to use a relative path as below,
RewriteRule "^old-folder/(.*)" "new-folder/$1"  [R=301,L]
This just doesn't work. The urls are redirected to http://localhost/var/www/project-folder/new/page-name. I don't understand how /var/www/ is appended within the link.

Sorry, meant to respond yesterday, but I couldn't really word what I was trying to say about it.  Time to try and salvage this reply... (It's not working... seems like I'm just dumping words on the page...)

You should probably just move your local project to /var/www/html to match the server, as this usually seems to be the standard.
I ran into this issue, odd redirect behavior and all, which was part of my confusion as well.  It happened when I tried using /var/www instead of /var/www/html, not realizing that there was a sites-available/000-default.conf file setting /var/www/html as the DocumentRoot.  It seemed like the mismatch was the cause.  The /var/www/ directory set in apache2.conf was NOT the DocumentRoot.
With the files in /var/www/html and the RewriteRule in 000-default.conf, everything worked as expected.
Although apache2.conf uses /var/www in its default Directory directive, most distros override this with a VirtualHost directive for security.  I found a lot of 2014-era posts explaining why Debian was making this change, and specifically going with /var/www/html to match other distros like Fedora.
You shouldn't need to do anything with the full URL.
The RewriteRule I used was RewriteRule "^/project_folder/blog/(.*)" "/project_folder/new/$1" [R,L]

I wouldn't use .htaccess for this unless you have to.  So what's the actual problem here?  No matter the DocumentRoot, it shouldn't affect your RewriteRule if the files are in the proper place.  It sounds like you're having the same issue as me, thinking that /var/www was the DocumentRoot just because it was the Directory in apache2.conf, when really DocumentRoot was set to /var/www/html in the VirtualHost section of 000-default.conf.
I'm not really sure how to help you with it any more at the moment. 😕😔
Going down the .htaccess and full URL route sounds like the wrong direction.  Does your server also use the sites-available config file paradigm? If so, you should use them to configure each site, and not apache2.conf or .htaccess.

Try with a leading slash on your .htaccess rule's replacement string.
RewriteRule "^old-folder/(.*)" "/new-folder/$1" [R=301,L]

Stumbled upon this when I was testing stuff. Seems to help. 🤔

The DocumentRoot inside sites-available/000-default.conf is indeed /var/www/; not /var/www/html. What I meant was, for the RrewriteRule inside .htaccess, the DocumentRoot is /var/www/html/project-folder, which is why, the pattern is matched. So DocumentRoot does not seem to be the problem. So here are my tries:

Inside .htaccess, the RewriteRule "^old/(.*)" "new/$1"  [R=301,L] rule gives me:
http://localhost/var/www/project-folder/new/page instead of http://localhost/project-folder/new/page in my system, and
https://example.com/var/www/project-folder/new/page instead of https://example.com/new/page in the production server.
Not sure why the string /var/www/project-folder is inserted in the link. I tried adding / to the pattern, like "^/old/(.*)", but it doesn't match the url at all.

Try with a leading slash on your .htaccess rule's replacement string.

Tried it on my system. RewriteRule "^old/(.*)" "/new/$1"  [R=301,L] and the browser redirects to http://localhost/new/page. I think we are missing out something tiny here regarding the substitution part. The pattern "^old/(.*)" is fine. It is the substitution causing the trouble.

In my local /sites-available/000-default.conf,
DocumentRoot /var/www/
RewriteEngine On
RewriteRule "^/project-folder/old/(.*)" "/project-folder/new/$1" [R=301,L]

This works perfectly. But the same code in my production /sites-available/000-default.conf,
DocumentRoot /var/www/
RewriteEngine On
RewriteRule "^/project-folder/old/(.*)" "/project-folder/new/$1" [R=301,L]

couldn't restart Apache server as it exited with an error code. Perhaps because I have configured virtual hosts for each site. So I went ahead and edited the virtual host configuration /etc/apache2/sites-available/project-folder.conf as,
DocumentRoot /var/www/project-folder

RewriteEngine On
RewriteRule "^/old/(.*)" "new/$1" [R=301,L]

And restarted Apache service but the pattern itself is not recognised. I tried without the leading / too in the pattern: "^old/(.*)", only to see the same result.

Now, I can use the full web address as the substitute although it is slightly inconvenient. This is not a one solution for both localhost and production, but that is the only alternative I have at this point.
Anyway, we've put quite a good amount of time into this thread and I think we should close this issue. Thank you so much for your help @mayamcdougall —as always, doing everything you can to help me. :smile: Thanks @PhrozenByte too.

Tried it on my system. RewriteRule "^old/(.*)" "/new/$1" [R=301,L] and the browser redirects to http://localhost/new/page.

Oh, wait. I guess I forgot to restore the project_folder subfolder for that attempt.  Sorry, been bouncing around between a few different configurations.  The / worked simply because it was replacing from the DocumentRoot in my case. I'd forgotten it was supposed to be in a subfolder. 🤦🏻♀
I have no idea why the substitution is inserting the system path at the start.

The DocumentRoot inside sites-available/000-default.conf is indeed /var/www/; not /var/www/html.

In my previous comment I tried to explain (poorly) how I had run into that issue before when adding the rule to apache2.conf instead of 000-default.conf.  But yeah, I saw the same behavior putting it in .htaccess too, just like you did.
Googling the specific problem itself (eg apache rewrite inserts system path /var/www) brought me to this StackOverflow Post, which might help a little.
Honestly, it kind of sounds like this is just something that happens when the path you're redirecting too isn't the DocumentRoot.  In fact, it even sounds like using the whole URL is part of the recommended solution.
Though, they also mention that using RedirectMatch instead of RewriteRule might work better, but I haven't tried that at all yet.
Might be worth a try.

Thank you so much for your help

No worries. Happy to help where I can. 😉
Mostly just bummed that I haven't had better answers on this one. 😓
I've been running Pico in the same Nginx Docker container for years now, so I don't really touch configuration that much.  Heck, I've been meaning to switch those sites over to Caddy for awhile now, because I've had a lot of luck using it as a Reverse Proxy on my server.  But I've just been far too busy/lazy to deep dive into that. 😂

I've been meaning to switch those sites over to Caddy for awhile now

Will check it out too.

Mostly just bummed that I haven't had better answers on this one. 😓

That's alright. :) If I get an answer to this issue, I'll update here too.

Will check it out too.

I mean, I'd definitely recommend trying Caddy out.  It does some amazing things, like HTTPS by default (with no effort on your part!).
However, just know that I can't really offer much for support on it.  I haven't looked into writing any Pico config for it yet.  At some point I plan to add a Caddy page to our Docs.
I'm pretty much only using it to Reverse Proxy my Docker containers right now.  It's kind of like the traffic director that points everything to the correct container.
All my configuration has been pretty simple so far, like
plex.example.com {
    reverse_proxy plex:32400
}

plex:32400 in this example is the hostname:port of my Plex container, allowing me to reach it at a plex subdomain of my home server.  I've taken to putting most of my web apps on their own subdomain for simplicity. 😉
I haven't gone any deeper than I've needed to so far.  But, that's the point with Caddy: It's designed to be easy to configure.  So far I've used the reverse_proxy, basicauth, and php_fastcgi directives and that's about it.
I do have my testing instance Pico running in it (using php_fastcgi php-fpm:9000 to utilize to a separate php container)... I just don't have any of the basic Pico security RegEx stuff implemented on it (blocking access to config, content, etc).  It's not an issue, since it's just my testing instance, but I'd definitely want to figure out the rest of it before I use it in production. 😅
Still, I'd highly recommend Caddy as long as you're comfortable learning (which, you seem to be, despite our fumbling around an Apache solution here 😂).


update de.json

Maybe duplicates in L31 and L234?

Maybe duplicates in L31 and L234?

Maybe, they have different contexts though, so may be different in some locales.
Thanks again for your contribution, I do appreciate it 😄


DATA tags in output have wrong converted chars after migrated to new build environment

In new compile environment, RPG source files stay in ccsid 819. CRTRPGMOD from IFS sources files could not specify conversion to job ccsid. The best way may be change the xmlservice code to be independent with source file ccsid. Use hexidecimal to initialize the Unicode constants for DATA tag.

@kadler I have DATA tag ccsid fixed. It's easy just a few lines of code. But when I look further, I see there are more char like '|' which has different ccsids between 819 and 37. I didn't find any parms to indicate CRTRPGMOD to convert IFS source file ccsid to job ccsid(37). So I am thinking one of the following options:

fix all the '|' alike chars with ccsid issues but the changes are not small.. many spots to check
change the build tool. maybe give extra parms to copy rpg sources files to ccsid 37 into a temp directory before make
I am appreciate if there are better ideas. Thanks!

@kadler I made changes to 819 chars that I am aware of in the code. then we can leave the build script as is. Could you approve my PR for 64-bit? My current changes are based on some files in that PR. Thanks!

more char like '|' which has different ccsids between 819 and 37

That's an understatement! 819 is an ASCII CCSID, while 37 is EBCDIC. I think the bigger issue is that '|' has different values between 37 and other EBCDIC CCSIDs (it's the same across all ASCII CCSIDs).
My guess is that the only way to make it really make it work (as XMLSERVICE works today) is to do a conversion to job CCSID for those replacement characters. Ideally, the XML would always be received in UTF-8 and generated in UTF-8. Using the stored procedures as convenient conversion to/from job ccsid for the general case just results in too many unfixable corner cases.

@kadler You are right that it is an issue crossing different CCSID's. To isolate with source file CCSID, I changed those chars that I am aware of to be UTF-16 coded for the constant variables and then covert to job ccsid chars in runtime to avoid the source CCSID issue for CRTRPDMOD.But there may be other chars missing for the fix.
Using UTF-8 as in and out is ideal, but I am worried both users' program and xmlservice need to be changed.
How about the other option.. change the compile script, first copy the 819 source files to /tmp and then change job ccsid to 37 and then make.. at last change ccsid back to origin ccsid(the default pase ccsid is changed to 1208 in 7.4). In current code, besides 819 issue, I noticed there were assumptions... think of the job ccsid is 37 when creating modules for some assignments of constant variables.

Yes, converting to UTF-8 is a much bigger issue and would require quite a big change. I think it's something that needs to be done at some point though.

@kadler My current changes that hardcode constants with UTF-16 won't hurt our future decision but as a temporary solution to make the xmlservice work. If you agree with that, I will submit a PR for review.

Closed by #36


Region support: Sweden Central/South

Hi, can you confirm that regions Sweden Central and Sweden South are supported?

Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ID: 0518f91e-08dc-a4d9-d163-7bffb2b0ebf1
Version Independent ID: 4bcce184-740a-bf41-ddad-b7e1589f2e06
Content: SAP HANA Backup support matrix - Azure Backup
Content Source: articles/backup/sap-hana-backup-support-matrix.md
Service: backup
GitHub Login: @jyothisuri
Microsoft Alias: jsuri

@dohughes-msft - thanks for writing to us. Sweden Central is a supported region for SAP HANA database backup, added this to the article. However, the support for Sweden South is currently in review, will update the article once confirmed by the Product Group, Thanks!

@dohughes-msft - Thanks again for bringing this to our attention. Hope @AbhishekMallick01 have answered your question and it will be live once its updated and merged.  We will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.


Raise a plan error on union if column count is not the same between plans

Which issue does this PR close?

Closes #13092
Rationale for this change
Raise the error earlier, restore the behaviour of previous versions of DF
What changes are included in this PR?
code, slt test.
Are these changes tested?
yes
Are there any user-facing changes?
no

This is good check to have. 👍
Obviously having same column count doesn't guarantee compatibility. The types need to be coercible, so normally the column count check should go together with the type check.
Reading rationale for https://github.com/apache/datafusion/pull/11961 it seems that we have two+ phases:

"loose" Logical Plans where types may not match

this is apparently the phase what plan builder operates at, because it directly supports dataframe frontend, I believe
then we do "type coercion optimizer" (which is not really an optimizer)

"strict" Logical Plans where types are expected to match

The consequence of this is that

it's unclear what guarantees are provided at which phase, because phases do not stand out in the code
we can still "type coercion optimizer" and other coercion related functions (like expr.get_type) on strict Logical Plans which cannot benefit from them

I would want to see these addressed, that's the idea of https://github.com/apache/datafusion/issues/12723.
Maybe we should have a form of validator of logical plan well-formedness (union branches match, the types match exactly) and the check would go there.
The downside of such approach (and of current state as well) is that, when you have code taking Logical Plan UNION, you can't really assume much (things may or may not have been checked), so the code needs to be very defensively written.
Wonder whether we can leverage Rust's compiler type system to help us with this.
cc @alamb @ozankabak @jonahgao

Maybe we should have a form of validator of logical plan well-formedness (union branches match, the types match exactly) and the check would go there.

I think this is what the the type coercion analyzer pass already does.
If the goal is to provide users errors sooner (when DataFrame is created) rather than later (when DataFrame is run) some other ideas:

Add a function to DataFrame (DataFrame::optimize, DataFrame::validate, DataFrame::check that runs)
Add some configuration / option that runs coercion logic automatically on each DataFrame call

Reading rationale for https://github.com/apache/datafusion/pull/11961 it seems that we have two+ phases:

I agree with this analysis and conclusion

type coercion optimizer" (which is not really an optimizer)

I agree it is not an optimizer -- that is why it an Analyzer datafusion::optimizer::analyzer::type_coercion::TypeCoercion
I think the analyzer docs explain this: https://docs.rs/datafusion/latest/datafusion/optimizer/trait.AnalyzerRule.html


Expose mapnik.logger

We should expose the mapnik.logger instance so that applications using node-mapnik can control - on the fly - what level of error reporting they desire.
/cc @gretacb

landed in #344


Cannot use .send on GuildMember object

Please describe the problem you are having in as much detail as possible:
Been testing around, and it seems I've been completely incapable of being able to send guild owners messages.
Include a reproducible code sample here, if possible:
msg.member.guild.owner.send("Test");
msg.guild.owner.send("Test");
msg.guild.member("ID").send("Test");

Confirmed Working:
msg.member.guild.owner.user.send("Test");
msg.guild.owner.user.send("Test");
msg.guild.member("ID").user.send("Test");

Error message:
19|Slice   | DiscordAPIError: Unknown Channel
19|Slice   |     at item.request.gen.end (/root/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:68:65)
19|Slice   |     at then (/root/node_modules/snekfetch/src/index.js:183:21)
19|Slice   |     at process._tickCallback (internal/process/next_tick.js:109:7)

Further details:

discord.js version: v12.0.0
node.js version: v7.10.0
Operating system: Ubuntu 16.04
Priority this issue should have – please be realistic and elaborate if possible: Moderate

[x] I have also tested the issue on latest master, commit hash: Commit 22e8237bf1644b1dd83aeeb4909a870f2a53b284

Fixed in 20a9e4a0


refactor: renaming "content" directory to "pages"

Renaming "content" directory to "pages" because it's deprecated.
$ cecil build
Building website...
"content" directory is deprecated, please rename it to "pages"
Done! 🎉

Hello @jawira, thank you for your contribution. I created another PR (#1435) to fix other related problem and I co-authored you.

@all-contributors please add @jawira for bug.


Revert "Show an error page if the rest api is not available"

Reverts DSpace/dspace-angular#1407 until issues with Authentication can be resolved. See https://github.com/DSpace/dspace-angular/pull/1407#issuecomment-1018003007

Merging immediately to fix Authentication issues on main and demo7.dspace.org.  Will also reopen #1389 until a new version of PR #1407 can be created.


Calling Gc.collect returns Gc for some reason

This can be observed in the REPL.
Mica 0.3.0 REPL
Press Ctrl-C to exit.

> Gc.collect
< <[type Gc]>

Fixed in b50aa632d4e1961a58ebe6f17bf09d9a9f454bba.


React Hooks + Typescript demo not working with current versions

Is just to address that the demo that showcases how to use the keyboard with React Hooks and Typescript seems to be outdated.
It is written as if simple-keyboards React components were still class components and they aren't.
This causes some type errors that might not be obvius to solve at first view and specially causes some doubt about if something should be done instead of "keyboar.current.setInput" call in the onChangeEvent call.
In functional components we don't have such function and indeed everything seems to work ok without calling it.
Updating it would be very helpful.

Hello @igorbga,
react-simple-keyboard is a wrapper of simple-keyboard (the vanilla JS version). As such, I don't plan to change this React wrapper in a way that would make it diverge too much from the source.
That being said, if you encounter any errors, please feel free to reach out on here or on Discord and I will be glad to help. Having issues tracked will also help others who use search to find a solution.
Thanks,
Francisco Hodge


Can model inference without "lidar2img" matrix?

I have read some your model code, but when I want to inferece by my image, I find I can't create a 'lidar2img' matrix。Can you tell how to inference without 'lidar2img'？

Hi @ChenSi521,
You are right, that for almost all our datasets we assume known intrinsic and extrinsic camera matrices. This is not suprising for outdoor datasets as we know all about sensors at the time they are placed on the vehicle.
The only model that can be run without lidar2img is for SUN RGB-D Total3DUnderstanding benchmark. Here we predict camera angles with additional 2d head.


False positive: FieldCanBeLocal reported when overriding default record constructor

Description of the problem:
Errorprone fails with FieldCanBeLocal on List<Integer> numbers in the record declaration (i.e. line 2 bellow).
record SomeRecord(
    List<Integer> numbers
)
{
    public SomeRecord(final List<Integer> numbers)
    {
        this.numbers = List.copyOf(numbers);
    }
}

What version of Error Prone are you using?
2.22.0
Have you found anything relevant by searching the web?
No.

Apologies, just noticed this seems to be a duplicate of https://github.com/google/error-prone/issues/3002


Log timeframes

The timestamps of the two overlapping subscriptions looks suspiciously close to each other.

Task linked: QF-2591 Subscription prevented because of active_since/active_until

Would you mind adding logger = logging.getLogger(__name__) in the begining of the file and s/logging/logger/?
Recently realized named loggers make life much easier also for debuging, e.g. silent everything but the logger you want.


💣  Remove transformers version check

What does this PR do?

Remove unnecessary version check: https://github.com/huggingface/trl/pull/2129#discussion_r1835666295
Before submitting

[ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
[x] Did you read the contributor guideline,
Pull Request section?
[ ] Was this discussed/approved via a GitHub issue? Please add a link
to it if that's the case.
[ ] Did you make sure to update the documentation with your changes? Here are the
documentation guidelines.
[ ] Did you write any new necessary tests?

Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.


Resolved(User Error): Two container setup, acme-companion fails to initialize with: "Error: can't get docker-gen container id"

Bug description
Resolved. Accidentally was using nginx image and not nginx-proxy.. a good signal to take a break :sweat_smile:

acme-companion fails initialization complaining about a lack of docker-gen container id.
Docs have been looked through extensively, issues searched. I may have missed something, but AFAIK my configuration is correct. AFAIK no third container (docker-gen) should be required for this setup.
This is a fresh setup on a newly provisioned VPS instance.
acme-companion image version
Please provide the container version that should be printed to the first line of log at container startup:
Info: running acme-companion version v2.1.0-25-g7f1b754

nginx-proxy's Docker configuration
Please provide the configuration (either command line, compose file, or other) of your nginx-proxy stack and your proxied container(s).
version: '3.7'

services:
  backend:
    environment:
      - VIRTUAL_HOST=example.com
      - LETSENCRYPT_HOST=example.com
      - LETSENCRYPT_TEST=true

  nginx:
    image: nginx
    container_name: nginx-proxy
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./docker-data/nginx-proxy/html/:/usr/share/nginx/html/:rw
      - ./docker-data/nginx-proxy/vhost.d/:/etc/nginx/vhost.d/:rw
      - ./docker-data/nginx-proxy/certs/:/etc/nginx/certs/:ro
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - ./docker-data/nginx-proxy/conf.d/:/etc/nginx/conf.d/

  acme-companion:
    image: nginxproxy/acme-companion
    container_name: nginx-proxy-acme
    volumes:
      - ./docker-data/nginx-proxy/html/:/usr/share/nginx/html/:rw
      - ./docker-data/nginx-proxy/vhost.d/:/etc/nginx/vhost.d/:rw
      - ./docker-data/nginx-proxy/certs/:/etc/nginx/certs/:rw
      - ./docker-data/nginx-proxy/acme.sh/:/acme.sh/:rw
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./docker-data/nginx-proxy/conf.d/:/etc/nginx/conf.d/
      - ./docker-data/nginx-proxy/standalone_certs.sh:/app/letsencrypt_user_data:ro
    environment:
      - NGINX_PROXY_CONTAINER=nginx-proxy
      - ACME_CA_URI=https://acme-staging-v02.api.letsencrypt.org/directory
      - DEBUG=1

rendered nginx configuration
Please provide the rendered nginx configuration:
docker exec name-of-the-nginx-container nginx -T

Expand for output
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
# configuration file /etc/nginx/nginx.conf:

user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log notice;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}

# configuration file /etc/nginx/mime.types:

types {
    text/html                                        html htm shtml;
    text/css                                         css;
    text/xml                                         xml;
    image/gif                                        gif;
    image/jpeg                                       jpeg jpg;
    application/javascript                           js;
    application/atom+xml                             atom;
    application/rss+xml                              rss;

    text/mathml                                      mml;
    text/plain                                       txt;
    text/vnd.sun.j2me.app-descriptor                 jad;
    text/vnd.wap.wml                                 wml;
    text/x-component                                 htc;

    image/png                                        png;
    image/svg+xml                                    svg svgz;
    image/tiff                                       tif tiff;
    image/vnd.wap.wbmp                               wbmp;
    image/webp                                       webp;
    image/x-icon                                     ico;
    image/x-jng                                      jng;
    image/x-ms-bmp                                   bmp;

    font/woff                                        woff;
    font/woff2                                       woff2;

    application/java-archive                         jar war ear;
    application/json                                 json;
    application/mac-binhex40                         hqx;
    application/msword                               doc;
    application/pdf                                  pdf;
    application/postscript                           ps eps ai;
    application/rtf                                  rtf;
    application/vnd.apple.mpegurl                    m3u8;
    application/vnd.google-earth.kml+xml             kml;
    application/vnd.google-earth.kmz                 kmz;
    application/vnd.ms-excel                         xls;
    application/vnd.ms-fontobject                    eot;
    application/vnd.ms-powerpoint                    ppt;
    application/vnd.oasis.opendocument.graphics      odg;
    application/vnd.oasis.opendocument.presentation  odp;
    application/vnd.oasis.opendocument.spreadsheet   ods;
    application/vnd.oasis.opendocument.text          odt;
    application/vnd.openxmlformats-officedocument.presentationml.presentation
                                                     pptx;
    application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
                                                     xlsx;
    application/vnd.openxmlformats-officedocument.wordprocessingml.document
                                                     docx;
    application/vnd.wap.wmlc                         wmlc;
    application/wasm                                 wasm;
    application/x-7z-compressed                      7z;
    application/x-cocoa                              cco;
    application/x-java-archive-diff                  jardiff;
    application/x-java-jnlp-file                     jnlp;
    application/x-makeself                           run;
    application/x-perl                               pl pm;
    application/x-pilot                              prc pdb;
    application/x-rar-compressed                     rar;
    application/x-redhat-package-manager             rpm;
    application/x-sea                                sea;
    application/x-shockwave-flash                    swf;
    application/x-stuffit                            sit;
    application/x-tcl                                tcl tk;
    application/x-x509-ca-cert                       der pem crt;
    application/x-xpinstall                          xpi;
    application/xhtml+xml                            xhtml;
    application/xspf+xml                             xspf;
    application/zip                                  zip;

    application/octet-stream                         bin exe dll;
    application/octet-stream                         deb;
    application/octet-stream                         dmg;
    application/octet-stream                         iso img;
    application/octet-stream                         msi msp msm;

    audio/midi                                       mid midi kar;
    audio/mpeg                                       mp3;
    audio/ogg                                        ogg;
    audio/x-m4a                                      m4a;
    audio/x-realaudio                                ra;

    video/3gpp                                       3gpp 3gp;
    video/mp2t                                       ts;
    video/mp4                                        mp4;
    video/mpeg                                       mpeg mpg;
    video/quicktime                                  mov;
    video/webm                                       webm;
    video/x-flv                                      flv;
    video/x-m4v                                      m4v;
    video/x-mng                                      mng;
    video/x-ms-asf                                   asx asf;
    video/x-ms-wmv                                   wmv;
    video/x-msvideo                                  avi;
}

Containers logs
Please provide the logs of:

your acme-companion container
your nginx-proxy container (or nginx and docker-gen container in a three containers setup)

docker logs name-of-the-companion-container

acme-companion:
Attaching to nginx-proxy-acme
nginx-proxy-acme  | Info: running acme-companion version v2.1.0-25-g7f1b754
nginx-proxy-acme  | Error: can't get docker-gen container id !
nginx-proxy-acme  | If you are running a three containers setup, check that you are doing one of the following :
nginx-proxy-acme  |     - Set the NGINX_DOCKER_GEN_CONTAINER env var on the letsencrypt-companion container to the name of the docker-gen container.
nginx-proxy-acme  |     - Label the docker-gen container to use with 'com.github.jrcs.letsencrypt_nginx_proxy_companion.docker_gen'.
nginx-proxy-acme exited with code 1

nginx-proxy:
Attaching to nginx-proxy
nginx-proxy       | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
nginx-proxy       | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
nginx-proxy       | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
nginx-proxy       | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist
nginx-proxy       | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
nginx-proxy       | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
nginx-proxy       | /docker-entrypoint.sh: Configuration complete; ready for start up
nginx-proxy       | 2021/09/23 03:22:30 [notice] 1#1: using the "epoll" event method
nginx-proxy       | 2021/09/23 03:22:30 [notice] 1#1: nginx/1.21.3
nginx-proxy       | 2021/09/23 03:22:30 [notice] 1#1: built by gcc 8.3.0 (Debian 8.3.0-6)
nginx-proxy       | 2021/09/23 03:22:30 [notice] 1#1: OS: Linux 5.11.0-17-generic
nginx-proxy       | 2021/09/23 03:22:30 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
nginx-proxy       | 2021/09/23 03:22:30 [notice] 1#1: start worker processes
nginx-proxy       | 2021/09/23 03:22:30 [notice] 1#1: start worker process 22

Docker host
OS: Ubuntu 21.04 (Kernel 5.11, built May 2021)
docker-compose version:
docker-compose version 1.25.0, build unknown
docker-py version: 4.1.0
CPython version: 3.9.5
OpenSSL version: OpenSSL 1.1.1j  16 Feb 2021

docker version:
Client: Docker Engine - Community
 Version:           20.10.8
 API version:       1.41
 Go version:        go1.16.6
 Git commit:        3967b7d
 Built:             Fri Jul 30 19:53:57 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.8
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.6
  Git commit:       75249d8
  Built:            Fri Jul 30 19:52:06 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.9
  GitCommit:        e25210fe30a0a703442421b0f60afac609f950a3
 runc:
  Version:          1.0.1
  GitCommit:        v1.0.1-0-g4144b63
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Sorry.. this was a typo on my part from being tired. The image name is nginx not nginx-proxy..

Resolved: Troubleshooting the init scripts
Related init logic
Initialization fails on this conditional:
https://github.com/nginx-proxy/acme-companion/blob/7f1b75460d2a4ba9aa81e6da06c3119b41ef94db/app/entrypoint.sh#L145-L161
Which calls the following functions:
https://github.com/nginx-proxy/acme-companion/blob/7f1b75460d2a4ba9aa81e6da06c3119b41ef94db/app/functions.sh#L235-L286

I have deviated from the volumes_from approach, but followed the documentation to provide a NGINX_PROXY_CONTAINER ENV to identify nginx-proxy container. The docker label and some other content in the scripts still reference the previous project name, so the ENV seemed most appropriate.
As the first conditional was not triggered, the ENV is working fine and moves onto the next conditional for Docker Gen.
I have tried to follow the logic flow here but AFAIK, [[ -z "$(get_docker_gen_container)" ]] should evaluate to false and ! is_docker_gen_container "$(get_nginx_proxy_container)" would likewise return false from is_docker_gen_container, resulting in FALSE && TRUE... I believe the initial FALSE would short-circuit, but either way this conditional statement should evaluate to false and not trigger the failure about docker-gen?
Clearly this is not the case. get_docker_gen_container must be returning a value that evaluates to true..

That said, the main confusion that led to raising a bug report before realizing the actual problem was that the check for NGINX_PROXY_CONTAINER doesn't care if the value is valid, there's no attempt to verify if that matches a valid nginx-proxy container instance, which was a bit misleading as I was under the impression that was working well.
Besides adding this validation into the init script, the bug report could also request the user to provide the nginx-proxy version output like it does for acme-companion, that would have also surfaced my mistake earlier! :)

@polarathene I don't know if you can do a PR on the issue template, feel free to do so if it is possible, contributions like those are welcome 👍


Backend views should only reference backend routes

Some solidus_auth_devise users will not be using solidus_frontend and
therefore, may not have the non-admin version of the user route helpers.

:+1:, thanks Brian.


Use JsonpMainTemplatePlugin.hooks instead of MainTemplate#hooks

Refactor JsonpMainTemplatePlugin plugin to change how hooks are installed into MainTemplate.
cc @jantimon
What kind of change does this PR introduce?
refactoring
Did you add tests for your changes?
no
Does this PR introduce a breaking change?
yes
What needs to be documented once your changes are merged?
Maybe JsonpMainTemplatePlugin.hooks.

@sokra @ooflorent I really like that approach and will also use it for the html-webpack-plugin.
Just one thing - some Plugins might provide a hooks object but others will require a context argument.
Imho we should prefix get functions e.g.: getHooks to be more consistent.
JsonpMainTemplatePlugin.getHooks(
vs
compilation.hooks

Should we add a instanceof MainTemplate check? It's very easy to do it wrong, i. e. JsonpMainTemplatePlugin.getHooks(compilation). This doesn't throw, but also don't work as expected. A instanceof MainTemplate could help by throwing an error.

Thanks