Web3Box

Project Abstract

Please replace these instructions with a brief description of your project summarising key points (1-2 paragraphs).
If your application is a follow-up to a previous grant, please mention which one in the first line of the abstract and include a link to previous pull requests if applicable.

Grant level

[x] Level 1:  Up to $10,000, 2 approvals
[ ] Level 2:  Up to $30,000, 3 approvals
[ ] Level 3:  Unlimited, 5 approvals (for >$100k: Web3 Foundation Council approval)

Application Checklist

[x] The application template has been copied and aptly renamed (project_name.md).
[x] I have read the application guidelines.
[x] A BTC, Ethereum (USDT/USDC/DAI) or Polkadot/Kusama (aUSD) address for the payment of the milestones is provided inside the application.
[x] The software delivered for this grant will be released under an open-source license specified in the application.
[x] The initial PR contains only one commit (squash and force-push if needed).
[x] The grant will only be announced once the first milestone has been accepted (see the announcement guidelines).
[ ] I prefer the discussion of this application to take place in a private Element/Matrix channel. My username is: @_______:matrix.org (change the homeserver if you use a different one)

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

Hi @web3andrew. Thank you for the application. I left a few questions below. Broadly speaking, there are several big issues with this:
1. There is a mismatch between the architecture diagrams and the deliveries. You are suggesting to include a lot of things, but there are no matching deliverables. If you want to fund parts of your project with a grant, please keep the application's focus on those parts. Also, please keep in mind that the deliverables still need to be useful on their own.

2. There is a lack of technical details. What tech stack are you planning to use? What makes your sandbox secure? Where do the asset and transaction data come from?

3. Since we cannot sign off on a milestone with cost "TBD", it's probably best to remove it. You could apply for a follow-up grant if and when the first grant is delivered and accepted.

4. There is no activity on your or your organisation's Github accounts. It would really help if you could show some experience with building and maintaining open source software and Substrate- or blockchain-related projects.

@semuelle  Thanks

Hi @web3andrew. Thank you for the application. I left a few questions below. Broadly speaking, there are several big issues with this:
1. There is a mismatch between the architecture diagrams and the deliveries. You are suggesting to include a lot of things, but there are no matching deliverables. If you want to fund parts of your project with a grant, please keep the application's focus on those parts. Also, please keep in mind that the deliverables still need to be useful on their own.

2. There is a lack of technical details. What tech stack are you planning to use? What makes your sandbox secure? Where do the asset and transaction data come from?

3. Since we cannot sign off on a milestone with cost "TBD", it's probably best to remove it. You could apply for a follow-up grant if and when the first grant is delivered and accepted.

4. There is no activity on your or your organisation's Github accounts. It would really help if you could show some experience with building and maintaining open source software and Substrate- or blockchain-related projects.

@semuelle Thanks, sir, we will update what you metioned asap.

Hi @web3andrew. Thank you for the application. I left a few questions below. Broadly speaking, there are several big issues with this:
1. There is a mismatch between the architecture diagrams and the deliveries. You are suggesting to include a lot of things, but there are no matching deliverables. If you want to fund parts of your project with a grant, please keep the application's focus on those parts. Also, please keep in mind that the deliverables still need to be useful on their own.

2. There is a lack of technical details. What tech stack are you planning to use? What makes your sandbox secure? Where do the asset and transaction data come from?

3. Since we cannot sign off on a milestone with cost "TBD", it's probably best to remove it. You could apply for a follow-up grant if and when the first grant is delivered and accepted.

4. There is no activity on your or your organisation's Github accounts. It would really help if you could show some experience with building and maintaining open source software and Substrate- or blockchain-related projects.

@semuelle  Thanks, sir, we will update what you metioned asap.

Hi @web3andrew. Thank you for the application. I left a few questions below. Broadly speaking, there are several big issues with this:
1. There is a mismatch between the architecture diagrams and the deliveries. You are suggesting to include a lot of things, but there are no matching deliverables. If you want to fund parts of your project with a grant, please keep the application's focus on those parts. Also, please keep in mind that the deliverables still need to be useful on their own.

2. There is a lack of technical details. What tech stack are you planning to use? What makes your sandbox secure? Where do the asset and transaction data come from?

3. Since we cannot sign off on a milestone with cost "TBD", it's probably best to remove it. You could apply for a follow-up grant if and when the first grant is delivered and accepted.

4. There is no activity on your or your organisation's Github accounts. It would really help if you could show some experience with building and maintaining open source software and Substrate- or blockchain-related projects.

@semuelle  Answers are as follows, and updated the application MD file https://github.com/w3f/Grants-Program/pull/1256/commits/e76de15433e3dcd957fc6896179dd813ddc2c1fb
Q1:
We deleted milestone2 and will focus on milestone1 (Dashboard & Multi-chain Wallet). We can make sure that Dashboard & Multi-chain Wallet would be useful after we finish milestone1. and then we will apply for the follow-up Milestone2 Risk Assessment for parachains.
Q2:
Web3Box Wins and Mac Clients will be provided after finishing Milestone1
Client language: React， Electron
Server language: Nodejs
Q3:
Deleted the Milestone2, and will continue to apply after finishing Milestone1
Q4:
ok, sir, we will update some work that we have done in our official GitHub account these days  https://github.com/web3box-labs/apps

@semuelle   Sir，already updated our Web3Box Github, you could check it out when you are available.

@semuelle  Sir, any update?

Thank you for the update, @web3andrew, and sorry for the late reply. The application looks better now, but could you expand on what I raised in Q2? How is this sandbox implemented? How is it safer than a well-tested browser plugin?

Sir，already updated our Web3Box Github, you could check it out when you are available.

Could you explain what this project is? I tried building and running it, but neither worked. It looks like a template react app.

@semuelle Firstly, we will provide the Mac & Win Web3Box Client for the Polkadot community, which could make community users' data saved locally and no interruptions from online attacks or viruses.
And second,  to some degree, a well-tested browser plugin may be safer than the DApps in Web3Box, but the data is still controlled under centralized institutions, correct? Web3Box is a completely decentralized client with no control or surveillance of users' data.
And last, what Web3Box aims to be is trying to provide the Web3 world with a  much safer and more decentralized way to access data, DApps, and Web3 Projects.
BTW, you could run and build the app after we finished the Milestone1, we need more time to update and rich its details.

And second, to some degree, a well-tested browser plugin may be safer than the DApps in Web3Box, but the data is still controlled under centralized institutions, correct? Web3Box is a completely decentralized client with no control or surveillance of users' data.

None of the wallets I know use a centralised service to store keys, and some allow you to use your own node. What centralised institutions do you mean?

BTW, you could run and build the app after we finished the Milestone1, we need more time to update and rich its details.

The reason I asked about the project currently on Github was that we like to see if applicants have previous experience with building and maintaining open source software. A bunch of template code doesn't help with that. Do you have any other code or project material you can share?
@semuelle
For centralized institutions, I mean that web2 products like Chrome Browser do control users' data and the users' data is under the surveillance of Chrome Browser. In contrast, Web3Box, Stand-alone & Decentralized Client , won't do that and will always allow users to keep data by themselves.

As for open source experience, our dev did participated in this defi project  https://github.com/netswap

@semuelle Sir, any update about our application? :)

Thanks for the update, @web3andrew, and sorry for the late reply. There is now an even bigger gap between the project description and the deliverables. I think a desktop wallet should first and foremost focus on its core functionality, which is reflected in this milestone, but your project description contains a lot of other stuff that I'm not particularly keen on. Also, you haven't been able to show any previous open source work. Therefore, I am not going to support this application. However, I will share your application with my colleagues, who might feel different.

Thanks for the update, @web3andrew, and sorry for the late reply. There is now an even bigger gap between the project description and the deliverables. I think a desktop wallet should first and foremost focus on its core functionality, which is reflected in this milestone, but your project description contains a lot of other stuff that I'm not particularly keen on. Also, you haven't been able to show any previous open source work. Therefore, I am not going to support this application. However, I will share your application with my colleagues, who might feel different.

@semuelle Thanks, sir, we will wait for W3F finial decision about our application.

Thanks for the update, @web3andrew, and sorry for the late reply. There is now an even bigger gap between the project description and the deliverables. I think a desktop wallet should first and foremost focus on its core functionality, which is reflected in this milestone, but your project description contains a lot of other stuff that I'm not particularly keen on. Also, you haven't been able to show any previous open source work. Therefore, I am not going to support this application. However, I will share your application with my colleagues, who might feel different.

@semuelle  Thanks sir, according to your feedback, our team has simplified the proposal, and we will focus on Polkadot eco desktop dashboard, wallet & risk management. I have updated the proposal again. Hope you that your colleagues and you could read this latest proposal. BTW, we really care what you mentioned that "your project description contains a lot of other stuff that I'm not particularly keen on." , some other stuff is our version about Web3Box, and therefore we deleted them which are not related with current milestones.

BTW, We do love Polkadot. We are DOT holders. And we do need a chance to contribute more for Polkadot Community.

Thanks for the application @web3andrew and for the deep dive @semuelle, I'm afraid I have to agree with the assessment that I wouldn't support this application in its current state. The price is reasonable, but:

The deliverables still don't contain any specifics on the tech used, as @Noc2 mentioned. What programming language is being used? (Rust, TypeScript, JavaScript, etc.) What will the front end be built in? (React, Vue, etc.) What kind of encryption is being implemented? Are you going to utilize an API service such as Subscan?

What does "risk assessment/management" mean exactly? The provided screenshot uses vague language and doesn't describe how the components work in detail.

The application has typos/formatting issues and vague language. For example, I don't believe "UGA platform" is an industry term that is widely used (I could be wrong). Another example is the formatting of the team member section. Not that the language has to be perfect, but currently it gives me the impression that not much effort was put into it.

As mentioned there is still no proof of prior development experience.

Your description of a "privacy-safe sandbox concept" sounds like an air-gapped wallet such as Parity Signer. Is this the idea you are going for and if so are you planning to utilize QR codes, or implement some other methods of security?

Also, a note about the price feed oracle, to be competitive I think you would need to update it much more than every 5 or 10 minutes. Most desktop wallets are capable of updating at speeds that feel like real-time.

Thanks for the application @web3andrew and for the deep dive @semuelle, I'm afraid I have to agree with the assessment that I wouldn't support this application in its current state. The price is reasonable, but:
1. The deliverables still don't contain any specifics on the tech used, as @Noc2 mentioned. What programming language is being used? (Rust, TypeScript, JavaScript, etc.) What will the front end be built in? (React, Vue, etc.) What kind of encryption is being implemented? Are you going to utilize an API service such as [Subscan](https://support.subscan.io/#extrinsic)?

2. What does "risk assessment/management" mean exactly? The provided [screenshot](https://user-images.githubusercontent.com/117150831/200757322-7e71bb05-9246-4367-bf43-f006627e1bab.png) uses vague language and doesn't describe how the components work in detail.

3. The application has typos/formatting issues and vague language. For example, I don't believe "UGA platform" is a widely used industry term (I could be wrong). Another example is the [formatting](https://github.com/web3andrew/Grants-Program/blob/master/applications/Web3Box.md#team-members) of the team member section. Not that the language has to be perfect, but currently it gives me the impression that not much effort was put into it.

4. As mentioned there is still no proof of prior experience on open-source projects.

5. Your description of a "privacy-safe sandbox concept" sounds like an air-gapped wallet such as [Parity Signer](https://github.com/paritytech/parity-signer). Is this the idea you are going for and if so are you planning to utilize QR codes, or implement some other methods with security in mind?

6. Also, a note about the price feed oracle, to be competitive I think you would need to update it much more than every 5 or 10 minutes. Most desktop wallets are capable of updating at speeds that feel like real-time.

Q1:
Tech Details
Client language: Electron.js   React.js
Server language: Node.js
Build tool: Webpack
API Details
On-chain Data: https://polkadot.subscan.io/
Price Data(in real-time): https://chain.link/
Btw, Added them in the last commit https://github.com/w3f/Grants-Program/pull/1256/commits/6fa13deb30b1cd130b223da942ab0d370b51477f
Q2:
Added more descriptions about Risk Assessment in the latest commit https://github.com/w3f/Grants-Program/pull/1256/commits/6fa13deb30b1cd130b223da942ab0d370b51477f
Q3:
Deleted "UGA" and privacy-safe box descriptions, and we decided that we would focus on the dashboard, multi-chain wallet and risk assessment of Web3Box Client. Optimized the team info.
Q4:
Team members have participated in the defi project https://github.com/netswap, Netswap official website https://netswap.io/
Q5:
Focus on the dashboard, multi-chain wallet, and risk assessment of Web3Box Client.
Q6:
Web3Box would get asset info from chainlink in real-time.

@semuelle @Noc2 @keeganquigley
Web3Box team made a big change about the proposal and we will focus on the implementation of milestone content such as Polkadot Dashboard, Multi-chain Wallet and Risk Assessment. We have streamlined the content of the Proposal by removing the UGA, privacy-safe box related descriptions.

Polkadot Ecology

@takahser @keeganquigley @Noc2 @semuelle
For Polkadot Ecology, I mean this https://coinmarketcap.com/view/polkadot-ecosystem/ we would provide the risk assessment for Polkadot Ecology projects in the above coinmarketcap list. And the basic functions, the Web3Box Polkadot Dashboard & Wallet would be related to some risk assessment linkage of Polkadot assets, contracts, and accounts, which was planned to do about personal risk assessment in the future. So wallet and risk assessment are not independent.
And now, for risk assessment, we are focusing on project risk assessment in Polkadot Ecology. The initial evaluation dimensions are as follows and will be described in more detail by follow-up grant, and finally, each project will get its own risk score according to the following evaluation dimensions.
Risk Type 1: Projects' Rug-pull
-Major holders' wallet assets distribution  (Data Source: blockchain explorer or other centralized third-party)
-Market Cap/ TVL (Data Source: Coinmarketcap)
-Twitter followers increasing rate  (Data Source: official Twitter )
-GitHub updating rate  (Data Source: official Github)
Risk Type 2: Projects' Attacking
-Audit Report (Data Source: audit institutions, like Certik, Slowmist, etc)
-Security Vulnerability (Data Source: audit institutions, like Certik, Slowmist, etc)
Risk Type 3: Related to other highly risky projects
-Investment and financing report  (Data Source: pitchbook)
-Cooperations with other projects (Data Source: official Twitter)
Risk Type 4: Users' Crash
-Token price volatility ( Data Source: Chainlink/Coinmarketcap)
-Rate of change in transactions volume ( Data Source: blockchain explorer)
-User sentiment index  ( Data Source: our devs will use an AI algorithm to figure out it basing on the comments of projects' Twitter)

Polkadot Ecology

@takahser @keeganquigley @Noc2 @semuelle For Polkadot Ecology, I mean this https://coinmarketcap.com/view/polkadot-ecosystem/ we would provide the risk assessment for Polkadot Ecology projects in the above coinmarketcap list. And the basic functions, the Web3Box Polkadot Dashboard & Wallet would be related to some risk assessment linkage of Polkadot assets, contracts, and accounts, which was planned to do about personal risk assessment in the future. So wallet and risk assessment are not independent.
And now, for risk assessment, we are focusing on project risk assessment in Polkadot Ecology. The initial evaluation dimensions are as follows and will be described in more detail by follow-up grant, and finally, each project will get its own risk score according to the following evaluation dimensions.
Risk Type 1: Projects' Rug-pull -Major holders' wallet assets distribution (Data Source: blockchain explorer or other centralized third-party) -Market Cap/ TVL (Data Source: Coinmarketcap) -Twitter followers increasing rate (Data Source: official Twitter ) -GitHub updating rate (Data Source: official Github)
Risk Type 2: Projects' Attacking -Audit Report (Data Source: audit institutions, like Certik, Slowmist, etc) -Security Vulnerability (Data Source: audit institutions, like Certik, Slowmist, etc)
Risk Type 3: Related to other highly risky projects -Investment and financing report (Data Source: pitchbook) -Cooperations with other projects (Data Source: official Twitter)
Risk Type 4: Users' Crash -Token price volatility ( Data Source: Chainlink/Coinmarketcap) -Rate of change in transactions volume ( Data Source: blockchain explorer) -User sentiment index ( Data Source: our devs will use an AI algorithm to figure out it basing on the comments of projects' Twitter)

@takahser @keeganquigley @Noc2 @semuelle   Hi, guys, any update? :)

Thanks for pinging us here. I will share the application again with the rest of the team.

Hi @web3andrew thanks for the updates and the additional detailed info. However, I think you can remove the 2. Risk Assement part since this module will be part of a follow-up grant, so we'll worry about it then.
Regarding your deliverables, 0e. Tech Details is not something we can evaluate, so can you remove this from the deliverables? Deliverables basically need to be tangible units of work that we can test and evaluate.
For 0f. API Details can you change this to describe how you will implement the API and what the final implementation might look like?
Considering the reasonable price for this grant, if you can fix the deliverables I will be in a better position to approve. Thanks!

@keeganquigley Hi, Keegan, I have updated the MD File according to your feedback, you could check it out. @Noc2 Hi, David, when I submitted the latest commit, Github dismissed your stale review automatically, but I did't know why it happened. Could you mark "APPROVED" again when you are available, sorry about the inconvenience.

Sure. Every time there is an update, I need to re-approve it and double-check that you haven't secretly increased the price, for example ;-)

Got it, I am not using Github very often since I am not a coder(But I am the Web3 builder, all in Web3 now). To be honest, I was very scared at that moment.

Thanks for the additional changes @web3andrew, I'm willing to give you a chance and approve the application now! Congratulations and I look forward to seeing what you can come up with.

Thanks for the additional changes @web3andrew, I'm willing to give you a chance and approve the application now! Congratulations and I look forward to seeing what you can come up with.

@Noc2 @keeganquigley Thanks, David & Keegan, appreciate you guys that giving us this chance and trusting Web3Box team, we will try our best to complete milestones and keep building Web3.

@semuelle @noc @keeganquigley  Hi, guys, what should I do with this? Unfortunately, I submitted our milestone delivery unsuccessfully.I have writen the address, contact name, contact email, and total cost in this latest application md b6bd8e139792bd83599ff1384c54d3387cd69434.


Directory update performance is very poor

I've done a lot of work that improves on this; closing as good enough for the time being.


Resolved #1639: display sni on ClientConnection

There is still one test cannot pass that I need your advise how could I solved that.
The test is test/mitmproxy/test_flow_format_compat.py that will load a dump file data/dumpfile-011
The dumpfile didn't contains sni info so that when the program try deserialize from dumpfile,
the state of ClientConnection didn't contains the sni field.
Is that I need add sni in the dumpfile manually? Or there is another way?
 I refrain from doing that right away to avoid unecessary merge conflicts)

Had fixed about how we get the sni, and io_compat.py for versions compatibility of dumpfile.
Please help review it, thanks!
I will help on #582 when I'm free and if there anyone else pick it up~

That was a quick turnaround - look great, thank you very much! 😊


Update dependencies to use nix >= 0.23 due to vulnerability

See: https://rustsec.org/advisories/RUSTSEC-2021-0119.html

https://github.com/rust-embedded/rust-i2cdev/pull/69
https://github.com/rust-embedded/rust-spidev/pull/37
https://github.com/rust-embedded/gpio-cdev/pull/67
https://github.com/rust-embedded/rust-sysfs-gpio/pull/72
https://github.com/milkey-mouse/openpty/pull/7 (dev-dependency, optional)
TODO: linux-embedded-hal

all lgtm, though i can't see that the particular issue has any impact in our crates.

Thanks! Indeed it does not seem so. However, anything that depends on it starts getting flagged by cargo-audit.
Since it is the first time this comes up, I figured we might as well update.

Thanks for picking this one up and running with it @eldruin


Multi GPU Training for a unet_learner

I am trying to figure out how to use multiple GPUs to speed up training for my segmentation model.
I looked at PyTorch's documentation (nn.DataParallel) and this link. However, I have not had success so far.
My first attempt was something like this:
if torch.cuda.device_count() > 1:
    wrapped_model = nn.DataParallel(learner.model)
    learner.model = wrapped_model.module

This does not have the intended effect. I only see 1 GPU being used.
I also saw the documentation here but from what I can tell unet_learner does not have the parallel_ctx context manager.
The other thing I tried doing was:
callbacks = [
    ParallelTrainer(device_ids=[0, 1]),
    EarlyStoppingCallback(min_delta=0.001, patience=5)
]
learner.fine_tune(20, freeze_epochs=2, wd=0.01, base_lr=0.0006, cbs=callbacks)

This is more promising, but I end up with the following error message:
RuntimeError: Expected tensor for argument #1 'input' to have the same device as tensor for argument #2 'weight'; but device 1 does not equal 0 (while checking arguments for cudnn_batch_norm)

Please use the forums for help.


Doesn't work on the server side using Next.js

I've tried to implement universal-cookie with the Next.js framework. I already have a working solution relying on js-cookie and cookies npm packages.

Current solution:
import * as Sentry from '@sentry/node';
import { COOKIE_LOOKUP_KEY_LANG } from '@unly/universal-language-detector/lib';
import { isBrowser } from '@unly/utils';
import ServerCookies, { SetOption, GetOption } from 'cookies';
import { IncomingMessage, ServerResponse } from 'http';
import BrowserCookies, { CookieAttributes } from 'js-cookie';
import uuid from 'uuid/v1'; // XXX Use v1 for uniqueness - See https://www.sohamkamani.com/blog/2016/10/05/uuid1-vs-uuid4/

import { PatchedUserSemiPersistentSession, UserSemiPersistentSession } from '../types/UserSemiPersistentSession';
import { addYears } from './date';

const USER_LS_KEY = 'user';

/**
 * Helper to manage cookies universally whether being on the server or browser
 *
 * Switches between BrowserCookies and ServerCookies depending on the runtime engine
 * Those two APIs being different (different projects), it deals with those differences, so that they're hidden away when using the helper
 *
 * XXX Do not try to pass down an instance of UniversalCookiesManager to Next.js "pageProps", or it'll throw a circular dependencies
 *  Instead, better instantiate a new UniversalCookiesManager when needed (without req/res if outside of "getInitialProps")
 */
export default class UniversalCookiesManager {
  private readonly req?: IncomingMessage;
  private readonly res?: ServerResponse;
  private readonly defaultServerOptions: SetOption = { // See https://www.npmjs.com/package/cookies#cookiesset-name--value---options--
    httpOnly: false, // Force cookies to be sent to the browser
    expires: addYears(new Date(), 10), // Force cookies to expire in 10 years
  };
  private readonly defaultBrowserOptions: CookieAttributes = { // See https://github.com/js-cookie/js-cookie#cookie-attributes
    expires: 365 * 10, // Force cookies to expire in 10 years
  };

  constructor(req?: IncomingMessage, res?: ServerResponse) {
    this.req = req || null;
    this.res = res || null;
  }

  /**
   * Replaces all user data stored in the browser's cookies by a new dataset
   *
   * @param {UserSemiPersistentSession} newUserData
   * @param serverOptions See https://www.npmjs.com/package/cookies#cookiesset-name--value---options--
   * @param browserOptions
   */
  replaceUserData(newUserData: UserSemiPersistentSession, serverOptions = this.defaultServerOptions, browserOptions: CookieAttributes = this.defaultBrowserOptions): void {
    if (isBrowser()) {
      // XXX By default, "js-cookies" apply a "percent encoding" when writing data, which isn't compatible with the "cookies" lib
      //  We therefore override this behaviour because we need to write proper JSON
      //  See https://github.com/js-cookie/js-cookie#encoding
      const browserCookies = BrowserCookies.withConverter({
        write: function (value: string, name: string) {
          return value;
        },
      });
      browserCookies.set(USER_LS_KEY, JSON.stringify(newUserData), browserOptions);
    } else {
      const serverCookies = new ServerCookies(this.req, this.res);

      // If running on the server side but req or res aren't set, then we don't do anything
      // It's likely because we're calling this code from a view (that doesn't belong to getInitialProps and doesn't have access to req/res even though if it's running on the server)
      if (this.req && this.res) {
        serverCookies.set(USER_LS_KEY, JSON.stringify(newUserData), serverOptions);
      }
    }
  }

  /**
   * Initializes the user data and stores them in the browser's cookies
   *
   * @return {UserSemiPersistentSession}
   */
  initUserData(): UserSemiPersistentSession {
    const deviceId: string = uuid();
    const userData: UserSemiPersistentSession = {
      id: deviceId, // XXX For now, the device id is used as user id too, because we have no way of uniquely identifying users
      deviceId,
    };

    this.replaceUserData(userData);

    return userData;
  }

  /**
   * Retrieves the user data stored in the browser's cookies
   *
   * If there are no such data, then initialise them
   *
   * @return {UserSemiPersistentSession}
   */
  getUserData(serverOptions?: GetOption): UserSemiPersistentSession {
    let rawUserData: string;

    if (isBrowser()) {
      rawUserData = BrowserCookies.get(USER_LS_KEY);

    } else {
      const serverCookies = new ServerCookies(this.req, this.res);

      // If running on the server side but req or res aren't set, then we don't do anything
      // It's likely because we're calling this code from a view (that doesn't belong to getInitialProps and doesn't have access to req/res even though if it's running on the server)
      if (this.req && this.res) {
        rawUserData = serverCookies.get(USER_LS_KEY, serverOptions);
      }
    }

    // If cookie's undefined, init (first visit)
    if (typeof rawUserData === 'undefined') {
      return this.initUserData();
    }

    try {
      const userData: UserSemiPersistentSession = JSON.parse(rawUserData);

      if (!userData) {
        return this.initUserData();
      } else {
        return userData;
      }

    } catch (e) {
      Sentry.withScope((scope) => {
        scope.setExtra('rawUserData', rawUserData);

        Sentry.captureException(e);
      });

      // eslint-disable-next-line no-console
      console.error(e);

      // Data unreadable, creating new data
      return this.initUserData();
    }
  }

  /**
   * Patches the existing user data stored in the browser's cookies with a patch
   *
   * This patch may contain any information, all fields are optional
   *
   * @param {PatchedUserSemiPersistentSession} patch
   */
  patchUserData(patch: PatchedUserSemiPersistentSession): void {
    this.replaceUserData({
      ...this.getUserData(),
      ...patch,
    });
  }

  /**
   * Change the language stored in the i18next cookie
   *
   * By default, no language is stored in the cookie and the app relies on the browser's language
   * Once the cookie is set, it'll rely on the cookie instead (through i18next)
   *
   * @param {string} lang
   * @param serverOptions
   */
  setLanguage(lang: string, serverOptions: SetOption = this.defaultServerOptions): void {
    if (isBrowser()) {
      BrowserCookies.set(COOKIE_LOOKUP_KEY_LANG, lang);
    } else {
      const serverCookies = new ServerCookies(this.req, this.res);
      serverCookies.set(COOKIE_LOOKUP_KEY_LANG, lang, serverOptions);
    }
  }
}

`universal-cookie` implementation:
import * as Sentry from '@sentry/node';
import { COOKIE_LOOKUP_KEY_LANG } from '@unly/universal-language-detector/lib';
import { IncomingMessage } from 'http';
import UniversalCookie, { CookieGetOptions, CookieSetOptions } from 'universal-cookie';
import Cookies from 'universal-cookie/cjs';
import uuid from 'uuid/v1'; // XXX Use v1 for uniqueness - See https://www.sohamkamani.com/blog/2016/10/05/uuid1-vs-uuid4/
import { PatchedUserSemiPersistentSession, UserSemiPersistentSession } from '../types/UserSemiPersistentSession';
import { addYears } from './date';

const USER_LS_KEY = 'user';

/**
 * Helper to manage cookies universally whether being on the server or browser
 *
 * Use universal-cookie to manage cookies with the same API whether used on the client or server side
 */
export default class UniversalCookiesManager {
  private readonly initialCookieHeader?: string | object;
  private readonly cookiesManager: Cookies;

  private readonly DEFAULT_COOKIE_SET_OPTIONS: CookieSetOptions = {
    httpOnly: false,
    sameSite: true,
    expires: addYears(new Date(), 10),
  };
  private readonly DEFAULT_COOKIE_GET_OPTIONS: CookieGetOptions = {
    doNotParse: false,
  };

  /**
   * Initialises internal cookie manager (instance of "universal-cookie")
   *
   * @param {IncomingMessage} cookieHeader
   */
  constructor(cookieHeader?: string | object) {
    console.log('cookieHeader', cookieHeader)
    this.initialCookieHeader = cookieHeader || null;
    this.cookiesManager = new UniversalCookie(this.initialCookieHeader);
  }

  /**
   * Replaces all user data stored in the browser's cookies by a new dataset
   *
   * @param {UserSemiPersistentSession} newUserData
   * @param options
   */
  replaceUserData(newUserData: UserSemiPersistentSession, options: CookieSetOptions = this.DEFAULT_COOKIE_SET_OPTIONS): void {
    console.log('newUserData', newUserData);
    this.cookiesManager.set(USER_LS_KEY, newUserData, options);
  }

  /**
   * Initializes the user data and stores them in the browser's cookies
   *
   * @return {UserSemiPersistentSession}
   */
  initUserData(): UserSemiPersistentSession {
    const deviceId: string = uuid();
    const userData: UserSemiPersistentSession = {
      id: deviceId, // XXX For now, the device id is used as user id too, because we have no way of uniquely identifying users
      deviceId,
    };

    this.replaceUserData(userData);

    return userData;
  }

  /**
   * Retrieves the user data stored in the browser's cookies
   *
   * If there are no such data, then initialise them
   *
   * @return {UserSemiPersistentSession}
   */
  getUserData(cookieGetOptions: CookieGetOptions = this.DEFAULT_COOKIE_GET_OPTIONS): UserSemiPersistentSession {
    const rawUserData: string = this.cookiesManager.get(USER_LS_KEY, cookieGetOptions);
    console.log('rawUserData', rawUserData);
    // If cookie's undefined, init (first visit)
    if (typeof rawUserData === 'undefined') {
      return this.initUserData();
    }

    try {
      const userData: UserSemiPersistentSession = JSON.parse(rawUserData);

      if (!userData) {
        return this.initUserData();
      } else {
        return userData;
      }

    } catch (e) {
      Sentry.withScope((scope) => {
        scope.setExtra('rawUserData', rawUserData);

        Sentry.captureException(e);
      });

      // eslint-disable-next-line no-console
      console.error(e);

      // Data unreadable, creating new data
      return this.initUserData();
    }
  }

  /**
   * Patches the existing user data stored in the browser's cookies with a patch
   *
   * This patch may contain any information, all fields are optional
   *
   * @param {PatchedUserSemiPersistentSession} patch
   */
  patchUserData(patch: PatchedUserSemiPersistentSession): void {
    this.replaceUserData({
      ...this.getUserData(),
      ...patch,
    });
  }

  /**
   * Change the language stored in the i18next cookie
   *
   * By default, no language is stored in the cookie and the app relies on the browser's language
   * Once the cookie is set, it'll rely on the cookie instead (through i18next)
   *
   * @param {string} lang
   * @param {CookieSetOptions} options
   */
  setLanguage(lang: string, options: CookieSetOptions = this.DEFAULT_COOKIE_SET_OPTIONS): void {
    this.cookiesManager.set(COOKIE_LOOKUP_KEY_LANG, lang, options);
  }
}

Server logs:
cookieHeader amplitude_id_825bf3376b4db9afa3546697cd0b8a6e=eyJkZXZpY2VJZCI6IjUyYzg2OGFlLWIxOTctNDE0ZS04NGU3LTk4NzY0YTc4YWM5YlIiLCJ1c2VySWQiOiJkMzVjMjhiMC00NWRlLTExZWEtODBjMy05YmM3NDgwMWM4YWYiLCJvcHRPdXQiOmZhbHNlLCJzZXNzaW9uSWQiOjE1ODA2NjI5ODI4NDIsImxhc3RFdmVudFRpbWUiOjE1ODA2NjMzOTQ1MTIsImV2ZW50SWQiOjgsImlkZW50aWZ5SWQiOjE0LCJzZXF1ZW5jZU51bWJlciI6MjJ9
rawUserData undefined
newUserData { id: '3892f4c0-45df-11ea-80c3-9bc74801c8af',
  deviceId: '3892f4c0-45df-11ea-80c3-9bc74801c8af' }
userSession { id: '3892f4c0-45df-11ea-80c3-9bc74801c8af',
  deviceId: '3892f4c0-45df-11ea-80c3-9bc74801c8af' }

See diff: https://www.diffchecker.com/7P1NphzT

Basically, when I first load the web page, the cookie user is supposed to be created. It works fine with js-cookie/cookies but not with universal-cookie. The cookie isn't created from the server side.
If I navigate through a page, then the client side takes over and creates the cookie properly. Then, whether I use SSR/CSR, it works as expected because the cookie is found in both cases, and used as expected.
There is no error whatsoever on client/server logs. This fails silently.
Also, I don't understand how you can set a cookie from the server side without having access to req or res, I thought that had to be done using res. 🤔

On server side, you have to pass it the request object.
My usage looks like this:
export default function AuthClient({ req } = {}) {
    const client = this;
    const cookies = req ? new Cookies(req.headers.cookie) : new Cookies();
    ...more code
}

Thanks. How come did I miss that...

@tvongeldern Actually, I looked deeper and that's what I already do in the constructor:
  constructor(cookieHeader?: string | object) {
    console.log('cookieHeader', cookieHeader)
    this.initialCookieHeader = cookieHeader || null;
    this.cookiesManager = new UniversalCookie(this.initialCookieHeader);
  }

Might also want to check your cookie options. Maybe you configured some cookies option like samesite, path, domain that is causing the cookie not to be passed from server to client

In which cases are the cookies not shared with the browser?
Here is the current code (as listed in the original issue):
  private readonly DEFAULT_COOKIE_SET_OPTIONS: CookieSetOptions = {
    httpOnly: false,
    sameSite: true,
    expires: addYears(new Date(), 10),
  };

Reading https://web.dev/samesite-cookies-explained/ it doesn't seem that sameSite would not propagate the cookie to the client.

Without seeing your whole project it’s hard to troubleshoot your issue, but Id recommend removing those options one by one to see if it helps

Hi all,
Reproduction bug with Next.js
https://codesandbox.io/s/charming-roentgen-lq8xh?file=/withCookie.js
In the server ok but in the client empty cookie.
import Cookies from "universal-cookie";
import { CookiesProvider } from "react-cookie";

const cookieHeader =
  "_octo=GH1.1.408396542.1595990120; _ga=GA1.2.1273452160.1595990121; tz=Asia%2FSaigon";

const cookies = new Cookies(cookieHeader);

export const withCookie = (Page) => {
  const WithCookie = (props) => {

    return (
      <CookiesProvider cookies={cookies}>
        <Page {...props} />
      </CookiesProvider>
    );
  };

  return WithCookie;
};

Hi all,
Reproduction bug with Next.js
https://codesandbox.io/s/charming-roentgen-lq8xh?file=/withCookie.js
In the server ok but in the client empty cookie.
import Cookies from "universal-cookie";
import { CookiesProvider } from "react-cookie";

const cookieHeader =
  "_octo=GH1.1.408396542.1595990120; _ga=GA1.2.1273452160.1595990121; tz=Asia%2FSaigon";

const cookies = new Cookies(cookieHeader);

export const withCookie = (Page) => {
  const WithCookie = (props) => {

    return (
      <CookiesProvider cookies={cookies}>
        <Page {...props} />
      </CookiesProvider>
    );
  };

  return WithCookie;
};


Error 500 in Laravel

Since I added this package middleware to my kernel.php my website return error 500 and even turning debug mode to true in .env file it does not show what the error is. But if I comment the middleware my site runs as usual without issue.
Config file
<?php

$protocol = 'https://';
if (! isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off') {
    $protocol = 'http://';
}

return [

    /*
     * Server
     *
     * Reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server
     *
     * Note: when server is empty string, it will not add to response header
     */

    'server' => '',

    /*
     * X-Content-Type-Options
     *
     * Reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options
     *
     * Available Value: 'nosniff'
     */

    'x-content-type-options' => 'nosniff',

    /*
     * X-Download-Options
     *
     * Reference: https://msdn.microsoft.com/en-us/library/jj542450(v=vs.85).aspx
     *
     * Available Value: 'noopen'
     */

    'x-download-options' => 'noopen',

    /*
     * X-Frame-Options
     *
     * Reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
     *
     * Available Value: 'deny', 'sameorigin', 'allow-from <uri>'
     */

    'x-frame-options' => 'sameorigin',

    /*
     * X-Permitted-Cross-Domain-Policies
     *
     * Reference: https://www.adobe.com/devnet/adobe-media-server/articles/cross-domain-xml-for-streaming.html
     *
     * Available Value: 'all', 'none', 'master-only', 'by-content-type', 'by-ftp-filename'
     */

    'x-permitted-cross-domain-policies' => 'none',

    /*
     * X-Powered-By
     *
     * Note: it will not add to response header if the value is empty string.
     */

    'x-powered-by' => '',

    /*
     * X-XSS-Protection
     *
     * Reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection
     *
     * Available Value: '1', '0', '1; mode=block'
     */

    'x-xss-protection' => '1; mode=block',

    /*
     * Referrer-Policy
     *
     * Reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy
     *
     * Available Value: 'no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin',
     *                  'same-origin', 'strict-origin', 'strict-origin-when-cross-origin', 'unsafe-url'
     */

    'referrer-policy' => 'no-referrer',

    /*
     * Clear-Site-Data
     *
     * Reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Clear-Site-Data
     */

    'clear-site-data' => [
        'enable' => false,

        'all' => false,

        'cache' => true,

        'cookies' => true,

        'storage' => true,

        'executionContexts' => true,
    ],

    /*
     * HTTP Strict Transport Security
     *
     * Reference: https://developer.mozilla.org/en-US/docs/Web/Security/HTTP_strict_transport_security
     *
     * Please ensure your website had set up ssl/tls before enable hsts.
     */

    'hsts' => [
        'enable' => true,

        'max-age' => 31536000,

        'include-sub-domains' => true,

        'preload' => false,
    ],

    /*
     * Expect-CT
     *
     * Reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expect-CT
     */

    'expect-ct' => [
        'enable' => false,

        'max-age' =><PHONE_NUMBER>,

        'enforce' => false,

        // report uri must be absolute-URI
        'report-uri' => null,
    ],

    /*
     * Permissions Policy
     *
     * Reference: https://w3c.github.io/webappsec-permissions-policy/
     */

    'permissions-policy' => [
        'enable' => true,

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/accelerometer
        'accelerometer' => [
            'none' => false,

            '*' => false,

            'self' => true,

            'origins' => [],
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/ambient-light-sensor
        'ambient-light-sensor' => [
            'none' => false,

            '*' => false,

            'self' => true,

            'origins' => [],
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/autoplay
        'autoplay' => [
            'none' => false,

            '*' => false,

            'self' => true,

            'origins' => [],
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/battery
        'battery' => [
            'none' => false,

            '*' => false,

            'self' => true,

            'origins' => [],
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/camera
        'camera' => [
            'none' => false,

            '*' => false,

            'self' => true,

            'origins' => [],
        ],

        // https://www.chromestatus.com/feature/5690888397258752
        // 'cross-origin-isolated' => [
        //     'none' => false,

        //     '*' => false,

        //     'self' => true,

        //     'origins' => [],
        // ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/display-capture
        'display-capture' => [
            'none' => false,

            '*' => false,

            'self' => true,

            'origins' => [],
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/document-domain
        'document-domain' => [
            'none' => false,

            '*' => true,

            'self' => false,

            'origins' => [],
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/encrypted-media
        'encrypted-media' => [
            'none' => false,

            '*' => false,

            'self' => true,

            'origins' => [],
        ],

        // https://wicg.github.io/page-lifecycle/#execution-while-not-rendered
        'execution-while-not-rendered' => [
            'none' => false,

            '*' => true,

            'self' => false,

            'origins' => [],
        ],

        // https://wicg.github.io/page-lifecycle/#execution-while-out-of-viewport
        'execution-while-out-of-viewport' => [
            'none' => false,

            '*' => true,

            'self' => false,

            'origins' => [],
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/fullscreen
        'fullscreen' => [
            'none' => false,

            '*' => false,

            'self' => true,

            'origins' => [],
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/geolocation
        'geolocation' => [
            'none' => false,

            '*' => false,

            'self' => true,

            'origins' => [],
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/gyroscope
        'gyroscope' => [
            'none' => false,

            '*' => false,

            'self' => true,

            'origins' => [],
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/magnetometer
        'magnetometer' => [
            'none' => false,

            '*' => false,

            'self' => true,

            'origins' => [],
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/microphone
        'microphone' => [
            'none' => false,

            '*' => false,

            'self' => true,

            'origins' => [],
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/midi
        'midi' => [
            'none' => false,

            '*' => false,

            'self' => true,

            'origins' => [],
        ],

        // https://drafts.csswg.org/css-nav-1/
        'navigation-override' => [
            'none' => false,

            '*' => false,

            'self' => true,

            'origins' => [],
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/payment
        'payment' => [
            'none' => false,

            '*' => false,

            'self' => true,

            'origins' => [],
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/picture-in-picture
        'picture-in-picture' => [
            'none' => false,

            '*' => true,

            'self' => false,

            'origins' => [],
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/publickey-credentials-get
        'publickey-credentials-get' => [
            'none' => false,

            '*' => false,

            'self' => true,

            'origins' => [],
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/screen-wake-lock
        'screen-wake-lock' => [
            'none' => false,

            '*' => false,

            'self' => true,

            'origins' => [],
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/sync-xhr
        'sync-xhr' => [
            'none' => false,

            '*' => true,

            'self' => false,

            'origins' => [],
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/usb
        'usb' => [
            'none' => false,

            '*' => false,

            'self' => true,

            'origins' => [],
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/web-share
        'web-share' => [
            'none' => false,

            '*' => false,

            'self' => true,

            'origins' => [],
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/xr-spatial-tracking
        'xr-spatial-tracking' => [
            'none' => false,

            '*' => false,

            'self' => true,

            'origins' => [],
        ],
    ],

    /*
     * Content Security Policy
     *
     * Reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
     */

    'csp' => [
        'enable' => true,

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
        'report-only' => false,

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/report-to
        'report-to' => '',

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/report-uri
        'report-uri' => [
            // uri
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/block-all-mixed-content
        'block-all-mixed-content' => false,

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/upgrade-insecure-requests
        'upgrade-insecure-requests' => false,

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/base-uri
        'base-uri' => [
            //
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/child-src
        'child-src' => [
            //
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/connect-src
        'connect-src' => [
            //
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/default-src
        'default-src' => [
            //
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/font-src
        'font-src' => [
            'allow' => [
                $protocol.'fonts.gstatic.com',
            ],
            'self' => true,
            'data' => true,
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/form-action
        'form-action' => [
            //
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors
        'frame-ancestors' => [
            //
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-src
        'frame-src' => [
            //
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/img-src
        'img-src' => [
            'allow' => [
                $protocol.'www.google-analytics.com',
            ],
            'self' => true,
            'data' => true,
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/manifest-src
        'manifest-src' => [
            //
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/media-src
        'media-src' => [
            //
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/navigate-to
        'navigate-to' => [
            'unsafe-allow-redirects' => false,
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/object-src
        'object-src' => [
            'allow' => [],
            'self' => false,
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/plugin-types
        'plugin-types' => [
            // 'application/pdf',
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/prefetch-src
        'prefetch-src' => [
            //
        ],

        // https://w3c.github.io/webappsec-trusted-types/dist/spec/#integration-with-content-security-policy
        'require-trusted-types-for' => [
            'script' => false,
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/sandbox
        'sandbox' => [
            'enable' => false,

            'allow-downloads-without-user-activation' => false,

            'allow-forms' => false,

            'allow-modals' => false,

            'allow-orientation-lock' => false,

            'allow-pointer-lock' => false,

            'allow-popups' => false,

            'allow-popups-to-escape-sandbox' => false,

            'allow-presentation' => false,

            'allow-same-origin' => false,

            'allow-scripts' => false,

            'allow-storage-access-by-user-activation' => false,

            'allow-top-navigation' => false,

            'allow-top-navigation-by-user-activation' => false,
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src
        'script-src' => [
            'none' => false,

            'self' => true,

            'report-sample' => false,

            'allow' => [
                // 'url',
                $protocol.'ajax.googleapis.com',
                $protocol.'code.jquery.com',
                $protocol.'www.googletagmanager.com',
                $protocol.'www.google-analytics.com',
            ],

            'schemes' => [
                // 'data:',
                // 'https:',
            ],

            /* followings are only work for `script` and `style` related directives */

            'unsafe-inline' => true,

            'unsafe-eval' => true,

            // https://www.w3.org/TR/CSP3/#unsafe-hashes-usage
            'unsafe-hashes' => false,

            // Enable `strict-dynamic` will *ignore* `self`, `unsafe-inline`,
            // `allow` and `schemes`. You can find more information from:
            // https://www.w3.org/TR/CSP3/#strict-dynamic-usage
            'strict-dynamic' => false,

            'hashes' => [
                'sha256' => [
                    // 'sha256-hash-value-with-base64-encode',
                ],

                'sha384' => [
                    // 'sha384-hash-value-with-base64-encode',
                ],

                'sha512' => [
                    // 'sha512-hash-value-with-base64-encode',
                ],
            ],
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src-attr
        'script-src-attr' => [
            //
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src-elem
        'script-src-elem' => [
            //
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src
        'style-src' => [
            'allow' => [
                $protocol.'fonts.googleapis.com',
            ],
            'self' => true,
            'unsafe-inline' => true,
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src-attr
        'style-src-attr' => [
            //
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src-elem
        'style-src-elem' => [
            //
        ],

        // https://w3c.github.io/webappsec-trusted-types/dist/spec/#trusted-types-csp-directive
        'trusted-types' => [
            'enable' => false,

            'allow-duplicates' => false,

            'default' => false,

            'policies' => [
                //
            ],
        ],

        // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/worker-src
        'worker-src' => [
            //
        ],
    ],
];

Any idea why?

I can not reproduce this error, could you provide an example repo?

Or just check your log file and let us know what the error 500 is.

Or just check your log file and let us know what the error 500 is.

I've removed this package and created header workers on cloudflare. My problem has solved that way. Thank you.

I've removed this package and created header workers on cloudflare. My problem has solved that way. Thank you.


Automatically email blog post notifications

Everyone who wants to get email notifications of new posts should get email notifications of new posts when there are new posts published.

deployed


fix: 裁剪上传接口与uploadModal统一：url

General

✏ Mark the necessary items without changing the structure of the PR template.

[x] Pull request template structure not broken

Type

ℹ What types of changes does your code introduce?

👉 Put an x in the boxes that apply

[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update

Checklist

ℹ Check all checkboxes - this will indicate that you have done everything in accordance with the rules in CONTRIBUTING.

👉 Put an x in the boxes that apply.

[x] My code follows the style guidelines of this project
[x] Is the code format correct
[x] Is the git submission information standard?
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[x] I have added tests that prove my fix is effective or that my feature works
[x] New and existing unit tests pass locally with my changes
[x] Any dependent changes have been merged and published in downstream modules

上传组件接口是 url，如下，所以建议裁剪组件上传接口统一。
https://github.com/vbenjs/vue-vben-admin/blob/31042de6bc0683132f57262e452dc3aa15cc8de0/src/components/Upload/src/UploadModal.vue#L254

emit('uploadSuccess', { source: previewSource.value, data: result.url });
应该改成
emit('uploadSuccess', { source: previewSource.value, data: result.data.url });
才能拿到数据吧。（感受是改出了bug）
当然这也要去后端返回结构里的一级结构就有url这个字段， 感觉不如之前的result.data来的灵活
vue-vben-admin/src/components/Upload/src/UploadModal.vue
里面应该改成
fileList.push(responseData);   比较灵活

确实应该是 result.data.url，我这么写是因为我自己的内容里，上传接口这里也改了，我给忘了 https://github.com/vbenjs/vue-vben-admin/blob/d3ec7a58ad96eda0db23a99614b65fa59602ec10/src/utils/http/axios/Axios.ts#L147-L157
不改的话，没有校验token，谁都能上传，容易被人利用
    return this.post({
      ...config,
      timeout: 10 * 60 * 1000,
      method: 'POST',
      data: formData,
      headers: {
        'Content-type': ContentTypeEnum.FORM_DATA,
        // @ts-ignore
        ignoreCancelToken: true,
      },
    });

@billyshen26 另外我个人认为， fileList.push(responseData); 比较灵活这个不合适，因为接口要有统一的 result 管理，用以区分各种报错，这个项目的其它接口也是这么做的，这也是为什么我把上传的接口也改成统一的 this.post （这个我忘了提交到这个项目了）


process.stdout buffering issue

I am experiencing and issue where lines of the help output are intermitently missed. It appears to be related to buffering/drain on the writes to process.stdout.
Specifically, the stdout/stderr calls to write() are not checking the return code, and not waiting for the drain event if/when required.
See https://nodejs.org/api/stream.html#writablewritechunk-encoding-callback
https://github.com/oclif/core/blob/f38f8270bafa04cdcb8e6d193b808e099e205864/src/ux/write.ts#L3-L25
I have replaced all calls with synchronous writes as follows and this appears to resolve the issue:
import {writeSync} from 'node:fs'

...
writeSync(process.stdout.fd, format(...str, ...args) + '\n')

Thoughts?
Has anyone else experienced this?

@danielsharvey can you create a repro that minimally replicates the issue?
I've tried to reproduce it with this script but haven't had any success:
import {ux} from '@oclif/core'

const lines = Array.from({length: 1_000_000}, (_, i) => `Line ${i}`)
const seen = new Set<string>()

// print the lines in parallel
await Promise.all(
  lines.map(async (line) => {
    ux.stdout(line)
    seen.add(line)
  }),
)

// Check that all lines were printed
if (seen.size === lines.length) {
  ux.stdout('All lines were printed')
} else {
  throw new Error('Not all lines were printed')
}

@mdonnalley Thanks for the prompt response! I will work on an independent test case, but let me share more testing in my codebase.
Importantly, I forgot to mention something looks to be be significant - I'm seeing this occur using Bun. My test case below errors ~70% time with Bun (as per below) but does not occur with Node. Having said that, I think handling "drain" is probably worth addressing.
What I've done is track the output and the process.stdout.write() return values.
First, a case when write() always returns true:

Second, a case when write() returned false 2 times out of 10:

I'm connecting this with the NodeJS docs where they say:

The return value is true if the internal buffer is less than the highWaterMark configured when the stream was created after admitting chunk. If false is returned, further attempts to write data to the stream should stop until the 'drain' event is emitted.

My test code is just added to<EMAIL_ADDRESS>as follows:

`write.js`
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.stderr = exports.stdout = void 0;
const node_util_1 = require("node:util");
const node_fs_1 = require("node:fs");

const counts = [0,0];
setTimeout(() => {
  console.log('COUNTS for write [false,true]:', counts);
}, 1000);

const stdout = (str, ...args) => {
    if (!str && args) {
        process.stdout.write((0, node_util_1.format)(...args) + '\n');
        // node_fs_1.writeSync(process.stdout.fd, (0, node_util_1.format)(...args) + '\n');
    }
    else if (!str) {
        process.stdout.write('\n');
        // node_fs_1.writeSync(process.stdout.fd, '\n');
    }
    else if (typeof str === 'string') {
        process.stdout.write((str && (0, node_util_1.format)(str, ...args)) + '\n');
        // node_fs_1.writeSync(process.stdout.fd, (str && (0, node_util_1.format)(str, ...args)) + '\n');
    }
    else {
        // process.stdout.write((0, node_util_1.format)(...str, ...args) + '\n');
        const ok = process.stdout.write((0, node_util_1.format)(...str, ...args) + '\n');
        counts[ok?1:0]++;
        // node_fs_1.writeSync(process.stdout.fd, (0, node_util_1.format)(...str, ...args) + '\n');
    }
};
exports.stdout = stdout;
const stderr = (str, ...args) => {
    if (!str && args) {
        process.stderr.write((0, node_util_1.format)(...args) + '\n');
        // node_fs_1.writeSync(process.stderr.fd, (0, node_util_1.format)(...args) + '\n');
    }
    else if (!str) {
        process.stderr.write('\n');
        // node_fs_1.writeSync(process.stderr.fd, '\n');
    }
    else if (typeof str === 'string') {
        process.stderr.write((str && (0, node_util_1.format)(str, ...args)) + '\n');
        // node_fs_1.writeSync(process.stderr.fd, (str && (0, node_util_1.format)(str, ...args)) + '\n');
    }
    else {
        process.stderr.write((0, node_util_1.format)(...str, ...args) + '\n');
        // node_fs_1.writeSync(process.stderr.fd, (0, node_util_1.format)(...str, ...args) + '\n');
    }
};
exports.stderr = stderr;

OK, test case was simpler than I thought. Similar to your test case but just using longer lines.
I'm seeing lots of skipped lines, with typical output from my test:
COUNTS for write [false,true]: [ 21, 79 ]

i.e. skipping 21 of 100 lines
The issue looks to be not handling the write() return code specifying that "further attempts to write data to the stream should stop until the 'drain' event is emitted".
As above it appears to show up for me using Bun (on my MBP). The issue does not occur for Node in my testing.
My test.js code:
const lines = Array.from({length: 100}, (_, i) => `Line ${i} Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer convallis fringilla sollicitudin. Nunc scelerisque neque non ipsum accumsan commodo. In et porttitor eros, ut vestibulum magna. Morbi felis diam, pharetra eu dui non, sollicitudin feugiat nisi. Aliquam cursus malesuada risus, vel luctus leo ornare sed. Morbi condimentum odio id ex facilisis bibendum. Nullam consectetur consectetur viverra. Donec nec ante dui. Integer lacinia facilisis urna vitae feugiat.`)

const counts = [ 0, 0 ];
lines.map((line) => {
  const ok = process.stdout.write(line + '\n');
  counts[ok ? 1:0]++;
});

console.log('COUNTS for write [false,true]:', counts);

@danielsharvey thanks for investigating it further! I've put up a PR to fix it. I think the easiest solution is to use console.log/console.error directly as it seems that those don't have an issue with back pressure. Happy to take suggestions for a better solution though

@mdonnalley I think that makes good sense. When I looked at write.ts originally I was not sure whether there was a reason I was not aware of for using process.stdout rather than console.log/console.error directly).


Adaptive lighting has a very slow loading time

Hi all,
The adaptive-lighting integration takes >11 seconds to load on my Raspberry Pi 4, Docker supervised. It is in the top-3 of the slowest-loading integrations i have come accross. It would be great if performance could get some attention.

I think this probably is because adaptive lighting waits until everything else is loaded.

@pimw1 does this answer your question? :)

Hi, partly. Two questions are in my mind:

is the hypothesis true? Even though it waits until everything else is loaded, it can still have a long loading time. Is that the case or not?
Why is this integration waiting for everything else to be loaded first? It sounds inefficient. But i don't have the inside knowlegde of Adaptive Lighting,, so it's easy for me to say.

Could someone shed some light on this?

I try to answer this (as Bas is super busy right now) - but haven't worked myself in the codebase yet, so just a guess:
The plugin depends on various other components which talks to the hardware, so it waits until those components are finished and then it will start up and hook into the lights to avoid to process all the boot up messages of the other plug-ins.

Thanks for taking this effort Ruben. What do you think about question 1?

This component doesn’t do any complicated calculations or communication. It should only take a few microseconds to do the calculations for the sun set and sunrise. so I am not particularly worried about a slow start ups times.
Ruben is correct with what he said above 😄

Thanks Bas! I'll close the issue.


custom blend mode with graphics.js:79 Uncaught TypeError: renderer.addBlendMode is not a function

This Issue is about an error I got in the console when viewing the phaser 3 examples:
custom blend mode with graphics.js:79
Uncaught TypeError: renderer.addBlendMode is not a function
http://<IP_ADDRESS>:8080/view.html?src=src\display\blend modes\custom blend mode with graphics.js
I'm new to phaser, and I apologize if this reported problem has already been addressed, I tried searching through the known issues and didn't see anything related. ( but maybe I did it wrong ... ? )
Any chance I could help develop phaser ( even though I have zero experience with it ? ) I'm a fairly decent developer with quite a bit of JavaScript experience.
Thanks,
Jeff

Yes, this method was left out of the new renderer by mistake. Have flagged it to be added in for 3.0.2 - thank you!

This is now fixed in the master branch and will be part of the 3.0.1 release.


Browser does not prompt for user-installed certificate for authentication

Certain webpages use user certificates to identify the user. Usually the webpage asks the browser for a certificate, and a menu with all valid certificates installed appears (For instance, in the web www.agenciatributaria.com, the IRS equivalent of Spain, it lists all certificates that the root of the entity validates (root certificates can be seen here: https://www.sede.fnmt.gob.es/descargas/certificados-raiz-de-la-fnmt)
When entering some specific procedures, a menu like the one in the picture usually shows up:

This works fine in update 124.0.6367.207
However since version 125.0.6422.60 this behaviour is broken, and the web browser does not prompt for the list of user certificates, so the webpage shows an error because it failed at identifying the user:

This might seem a minor thing to some, bur in spain companies need this to pay their taxes and do most procedures with the government.
I am willing to help troubleshoot this doing anything that is requested from me, but I can't give access to my certificates for others to experiment since they legally identify me and any action taken using them makes me legally responsible.

Can you check if the same behavior occurs with vanilla chromium?

Could be due to https://github.com/ungoogled-software/ungoogled-chromium-windows/blob/master/patches/ungoogled-chromium/windows/windows-fix-building-without-safebrowsing.patch#L18 (or https://github.com/ungoogled-software/ungoogled-chromium/blob/master/patches/core/ungoogled-chromium/fix-building-without-safebrowsing.patch#L1557 for the upcomming release).

Can you check if the same behavior occurs with vanilla chromium?

Th eproblem is caused on version: 125.0.6422.60
Checked the closest Vanilla version: Hibbiki Chromium 125.0.6422.61
The bug is not present in said version.

Could be due to https://github.com/ungoogled-software/ungoogled-chromium-windows/blob/master/patches/ungoogled-chromium/windows/windows-fix-building-without-safebrowsing.patch#L18 (or https://github.com/ungoogled-software/ungoogled-chromium/blob/master/patches/core/ungoogled-chromium/fix-building-without-safebrowsing.patch#L1557 for the upcomming release).

I'm not knowledgeable enough to know what I'm looking at, but if you know how to test it, I'm willing to try.

I tested it on Ubuntu 24.04 with portable ungoogled chromium 125.0.6422.76-1 and I get the 403 there as well. This is either a general problem with ungoogled chromium or we do not support user certificates. @Ahrotahn ?

It most likely is due to those changes.  If I remember correctly chunks of the client certificate store were removed due to some hooks into safebrowsing and the enterprise connectors.  I'll see if there's a way to decouple them without removing it entirely.

The fix is working and will be included in the next release.


Bug in sqlx.Named where ::text is incorrectly processed, leading to syntax erro

Description:
I encountered a bug while using sqlx.Named to bind query parameters in SQL queries that contain type casting (::text). The ::text syntax is being modified during the query parameter binding, causing the colon (:) to be removed. This leads to a syntax error in the SQL query.
Steps to Reproduce:
Use ::text in a SQL query for type casting in PostgreSQL.
Bind parameters using sqlx.Named.
The resulting query will have the colon (:) removed before text, causing a syntax error.
Example code:
companyId := 555
query := `SELECT DISTINCT
        t.path::text AS catalog_path
    WHERE t.company_id = :company_id
    FROM table AS t`
params := map[string]interface{}{
    "company_id": companyId,
}
query, args, err := sqlx.Named(query, params)

Resulting Query After sqlx.Named:
SELECT DISTINCT
        t.path:text AS catalog_path
    WHERE t.company_id = :company_id
    FROM table AS t

Error Encountered:
pq: syntax error at or near ":"
Expected Behavior:
The ::text type cast should remain unchanged in the query, and the parameter binding should work as expected.
Actual Behavior:
The colon (:) before text is removed, resulting in an invalid SQL query and a syntax error.

can you change ::text for ::::text? this is working for me


Authorization failed in Blazor server-side app

SDK: dotnet-sdk-3.0.100-preview8-013656-win-x64
IDE: Visual Studio 2019 16.3 Preview 2.0
OS: Windows 10 1903 (18362.1.amd64fre.19h1_release.190318-1202)
Using Windows Authentication, authorization in Blazor server-side app always results in NotAuthorized when using debug launch command 'Project' instead of 'IISExpress'.
Steps to reproduce using a new app:

Create a new Blazor App in Visual Studio (Server-side, Windows Authentication)
Debug the app using launch command 'IISExpress' -> The LoginDisplay component displays the Windows Username
Debug the app using launch command 'Project' -> The LoginDisplay component displays nothing. The log contains this message: [Microsoft.AspNetCore.Authorization.DefaultAuthorizationService] Authorization failed.

Before updating to .NET Core 3.0 preview8 I was using preview7 where this was not an issue.
I have an existing app which I migrated from preview7 to preview8. The MVC part of the app and the authorization works while the Blazor server-side part always results in NotAuthorized if I don't use IISExpress to debug.

Thanks for contacting us, @romandres.
@SteveSandersonMS don't we have a CTI scenario validating this daily?

@mkArtakMSFT No, we only have a CTI scenario covering the Identity auth case (not Windows auth).
In any case, as far as I'm aware, Windows Authentication is not expected to work by default when hosting directly on Kestrel, since Kestrel doesn't support it. I checked, and the default MVC site template with Windows authentication also doesn't work if you run it directly on Kestrel instead of IISExpress.
The fact that Kestrel doesn't support Windows Authentication directly is mentioned here, though I'm unsure where this fact is covered in official documentation.
It is possible to host ASP.NET Core on HTTP.sys directly and then enable Windows authentication via HTTP.sys, which should work the same with server-side Blazor. But setting it up is nontrivial as per docs.
@HaoK Do you agree with this diagnosis? Is there anything I've missed?

Closing this as by design.


$scope is not updated on Drag and Resize

I instantiate ui-calendar with $scope.events:
$scope.events = [{
    title: 'Move or Resize me',
    start: new Date(y, m, d, 8, 0),
    end: new Date(y, m, d, 10, 0)
}];

The event has initial Start and End dates (8am to 10am). But when it is resized or dragged, the scope is not updated, and the event still has it's original datetimes (8am to 10am).
Here's a jsFiddle: http://jsfiddle.net/sikko/o7fh0htz/1
Is this a normal behaviour ?
Thanks in advance.

I confirm the issue. My understanding of the problem is that FullCalendar creates a copy of each object uiCalendar provides. We therefore ends up wit two equivalent objects representing the event. One in FC world and one in uiCalendar world.
When uiCalendar needs to propagate changes from the scope to FC, the FC equivalent object is first found, then extended. Finally, the updateEvent method of FC is called on it:
https://github.com/angular-ui/ui-calendar/blob/master/src/calendar.js#L286
Event callbacks are currently called with FC objects. In my opinion, it is a bug. The callback we define in the uiConfig, should be called with the event from the scope after being extended by the 'updated' FC event.
The 'event' callbacks I am referring to are:

eventRender (callback)
eventAfterRender (callback)
eventAfterAllRender (callback)
eventDestroy (callback)

Practically, the wrapFunctionWithScopeApply  (https://github.com/angular-ui/ui-calendar/blob/master/src/calendar.js#L21) should be modified.
@joshkurz What is your opinion? Are you interested in a PR?
regards,

I think this might be even more serious problem than that. I started to monitor the application when I use my site and it seems to be creating absurd amount of scopes. When I added 128 new events at the same time, it actually created 5017 new scopes.
In addition, when I change months it actually creates new scopes for the events and leaves old scopes there.
Of course, there might be something wrong with my code, but so far it happens in the demo as well.
For me it shows up in both Batarang and ng-inspector.

@Sefriol Could you share your code in a fiddle or plunkr so we can have a look ?

I can try to do that when I got more time. For the second part of the problem you can just add events to the demo and change months. That should create some extra scopes.

i'm honestly thinking the calendar should go back to what it originally did and just reset the entire plugin on any change to the events. Things would be so much simpler for us, the only issue would be there would be a flash whenever something changes.

is there any solution to this issue ? @jkurz do you remember what version of calendar-ui and fullcalendar had the reset in the entire plugin? the flash when something changes isn't an issue for my implementation so that would be perfect for me :) thanks

I'm also interested in knowing what version was re-rendering the whole calendar

so I was wrong about the previous version of the calendar fixing this issue anyways. The previous calendar would not come close to fixing this issue. This issue currently can be solved by hacking the crap out your callback.
@antoinepairet you are right about the callbacks being fired with fullCalendar events, but I dont think this is a bug. This is intended. uiCalendar is just a wrapper around fullCalendar so if we returned the scope event in the callback, it would mean we would need to actually recreate each fullCalendar callback, which would be huge breaking change.
This can currently be done with one change I had to make to uiCalendar.
http://jsfiddle.net/3a0j3t19/
I had to add a check for a isDirty flag in the onChanged callback. This is because when the start and end dates are updated from the view callback, we do not want to send another update to fullCalendar. So I added a isDirty flag to the calendar. A pr could be made with this new flag. I think it works well.
I do understand this is not the optimal solution however and it would be nice to just have the scope's event in the callback, but im not sure of the best way to do that currently. @antoinepairet if you want to go ahead and try please do so by all means.

@jkurz Thanks for your reply.
I will give it a try when I have some spare time. I will keep you informed.
regards

Running into this issue as well. Any updates?

Running into this issue as well. Any updates?

Same issues here

Dirty Fix
 $scope.uiConfig = {
      calendar: {
       ...
        eventRender: $scope.eventRender,
        eventResizeStop: $scope.eventResizeStop,
        eventDragStop: $scope.eventDragStop,
   ...
      }
    };

$scope.eventRender = function (event, element, view) {
      $scope.currentEvent = event;
}

$scope.eventResizeStop = function (event, element, view) {

    // USE $scope.currentEvent instead of event
    };

    $scope.eventDragStop = function (event, element, view) {

      // USE $scope.currentEvent instead of event
    };
'''


Getting Started with Sleek

https://n20u.github.io/getting-started/
Jekyll Theme Minimal Blog

666


Asterisk GUI

Hi,
This is definitely not an issue, it's a enhancement request
Fist of all want to say that this addon is awesome and I was able to successfully run it. Thanks for the documentation. It helped a bit to me.
After I twiked a couple of the .conf files in my custom folder I found an http.conf. I turned it on and found only httpstatus page with the following information:
Asterisk™ HTTP Status
--
Server | Asterisk/20.5.2
Prefix | /asterisk
Bind Address | <IP_ADDRESS>
Bind Port | 8088
SSL Bind Port | 8089

It's nice to know that it works, but by doing a quick research I found the Asterisk GUI and I wonder why shouldn't be pre-install in addon.
I am new to Asterisk and the only one reason why I was able to configure it for my needs is that I am a developer. Yes, it took for me a couple of hours to find docs, understand concepts and adopt to that weird syntax
I wish Asterisk addon to be more user friendly for wider usage in HA community and IMHO it have to has a GUI.
Link: http://www.asteriskdocs.org/en/2nd_Edition/asterisk-book-html-chunk/I_sect111_tt1363.html
Thanks again for your work on this project.

The asterisk-gui project seems to be dead. I believe the last version was from 2009.
There is FreePBX, which is a extension of Asterisk and provides a GUI, and I tried to implement that first as a add-on, but I got into too many problems. FreePBX has a lot of unnessary features enabled and the GUI is very buggy and sometimes shows config incorrectly. We can't maintain something like that in a add-on, while keeping it updated and as plug-and-play as we have now.
I like the idea, and if a lightweight asterisk-gui was still available I would implement it. But for now the HTTP server is only used for WS for the card.
You can however use the integration to get some live information from Asterisk.
I guess you could also find (or even create) a GUI that connects to the AMI. Also saw a Grafana plugin.

Hi guys, only today found your responses and can say that today my option is to use FreePBX as a separate instance on Proxmox VE. It works perfectly and doesn't require me to remember how to configure it. UI is simple as for me. For any person who will find this message I strongly recommend to use FreePBX.
But the addon is also good as a light weight solution or when you need to configure only once without reconfiguring each half a year. It was fun to play with it. I felt something like a nostalgia for the old times. The use of this addon pushed me to move forward

I personally find the FreePBX idea great, but I think it would be better off being a separate add-on.
Also, I wonder how does both compare regarding resources. If FreePBX doesn't add up too much, I think it's a great tradeoff.


runtime: fatal error: unexpected signal during runtime execution

Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
go version go1.10 windows/amd64
Does this issue reproduce with the latest release?
no
What operating system and processor architecture are you using (go env)?
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Administrator\AppData\Local\go-build
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\GoPath;D:\Server_正式服
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\ADMINI~1\AppData\Local\Temp\2\go-build259
987786=/tmp/go-build -gno-record-gcc-switches
What did you do?
I did nothing
What did you expect to see?
Was expecting program could run fluently without any crash
What did you see instead?
fatal error: unexpected signal during runtime execution
[signal 0xc0000005 code=0x0 addr=0x7ef0128 pc=0x450f79]

runtime stack:
runtime.throw(0xf94e32, 0x2a)
	C:/Go/src/runtime/panic.go:619 +0x88
runtime.sigpanic()
	C:/Go/src/runtime/signal_windows.go:161 +0x170
runtime.gentraceback(0x45c90e, 0x7eefe60, 0x0, 0xc047af9b00, 0x0, 0x88ef260, 0x40, 0x0, 0x0, 0x6, ...)
	C:/Go/src/runtime/traceback.go:280 +0x14f9
runtime.sigprof(0x45c90e, 0x7eefe60, 0x0, 0xc047af9b00, 0xc0422a6c00)
	C:/Go/src/runtime/proc.go:3707 +0x4aa
runtime.profilem(0xc0422a6c00)
	C:/Go/src/runtime/os_windows.go:839 +0xea
runtime.profileloop1(0x0, 0x0)
	C:/Go/src/runtime/os_windows.go:858 +0xe6
runtime.externalthreadhandler(0x88efb90, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	C:/Go/src/runtime/sys_windows_amd64.s:263 +0x95

goroutine 1 [chan receive]:
MyEngine/routineevent.(*RoutineEvent).Run(0x14e5c40, 0xc0430e4000)
	D:/Server/src/MyEngine/routineevent/routineevent.go:119 +0x541
MyServer_Module/module_logic.Run()
	D:/Server/src/MyServer_Module/module_logic/module_logic.go:305 +0x132
MyServer_Module/module_run.Start(0xc042210fc0, 0x1, 0x1, 0x0, 0x0)
	D:/Server/src/MyServer_Module/module_run/module_run.go:31 +0xb7
main.main()
	D:/Server/src/MyServerAll/main.go:34 +0x35f

goroutine 17 [syscall, 1212 minutes]:
os/signal.signal_recv(0x0)
	C:/Go/src/runtime/sigqueue.go:139 +0xad
os/signal.loop()
	C:/Go/src/os/signal/signal_unix.go:22 +0x29
created by os/signal.init.0
	C:/Go/src/os/signal/signal_unix.go:28 +0x48

Was expecting program could run fluently without any crash

What program? There's no code in your message.

It's a large program , server part of an online game, too much code to attach, can't  position which part cost the crash right now

Does the it cgo?
Does compiling and then running it with the race detector enabled (-race) prints any race warning?

1.No cgo
2.Hundreds of player online right now, can't use race detector in case of high CPU&RAM usage

Oh, it does use cgo, it imported a package "gopkg.in/mgo.v2" and this package use cgo

This looks like it may be caused by memory corruption, either by erroneous cgo code or by a data race in your code. You should find a way to deploy a race-enabled version of the code on some subset of your servers or something like that.
I don't see how we could investigate (or do anything about) this, without having a reproducer or anything to work on.
cc @aclements in case he has something to say about the stack-trace

Thank you very much, I'll try to find one

This looks like a profiling signal occurred on a stack with an invalid frame pointer.  That should in general be impossible; not sure what happened here.

I think that to fix this we will need a way to reproduce this ourselves.

Hi, I think I have the same issue. I am duel booting GalliumOS and ChromeOS on an Asus Chromebook c302 flip. I am developing on GalliumOS. I am using the hedera hashgraph go sdk. I believe that one of their functions Public() is making a system service call that is causing a segmentation fault.
What version of Go are you using (go version)?
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/Sean/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/Sean/Dropbox/Research"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build451736839=/tmp/go-build -gno-record-gcc-switches"

Does this issue reproduce with the latest release?
yes
What did you do?
Attempted to run the following program using the hedera hashgraph go sdk.
package main

import (
	"fmt"

	"github.com/hashgraph/hedera-sdk-go"
)

func main() {
	secret, _ := hedera.GenerateSecretKey()

	fmt.Printf("Proof this line is printing.\n")

	public := secret.Public()

	fmt.Printf("public   = %v\n", public)
}

What did you expect to see?
Proof this line is printing.
public   = aBunchOfNumbers

What did you see instead?
Proof this line is printing.
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x80 addr=0x0 pc=0x652bd3]

runtime stack:
runtime.throw(0x6ae516, 0x2a)
        /usr/local/go/src/runtime/panic.go:608 +0x72
runtime.sigpanic()
        /usr/local/go/src/runtime/signal_unix.go:374 +0x2f2

goroutine 1 [syscall]:
runtime.cgocall(0x4910b0, 0xc000038640, 0x1)
        /usr/local/go/src/runtime/cgocall.go:128 +0x5e fp=0xc000038610 sp=0xc0000385d8 pc=0x40ae7e
github.com/hashgraph/hedera-sdk-go._Cfunc_hedera_public_key_from_secret_key(0xc0000161e0, 0x62ad80abe23ed, 0x20dff79ceacd5, 0x1bc391460852d, 0x17de07be442d9)
        _cgo_gotypes.go:450 +0x4e fp=0xc000038640 sp=0xc000038610 pc=0x48fdae
github.com/hashgraph/hedera-sdk-go.SecretKey.Public(0x40964715b4e53414, 0x614e508bbaa7853f, 0x8276fd839d5589b6, 0x62cfae0d1f6003a9, 0x0, 0x0, 0x0, 0x0)
        puposelyOmmitedDirectoryName/src/github.com/hashgraph/hedera-sdk-go/crypto.go:49 +0x66 fp=0xc0000386b8 sp=0xc000038640 pc=0x490486
main.main()
        puposelyOmmitedDirectoryName/src/Generate Keys/keys.go:14 +0xa9 fp=0xc000038798 sp=0xc0000386b8 pc=0x490d99
runtime.main()
        /usr/local/go/src/runtime/proc.go:201 +0x207 fp=0xc0000387e0 sp=0xc000038798 pc=0x431517
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1333 +0x1 fp=0xc0000387e8 sp=0xc0000387e0 pc=0x4597c1
exit status 2

Steps to reproduce

Create an environment that is using GalliumOS and Go
Follow the install instructions for the hedera go sdk up to and including the section Installing the Hedera SDK for Go here
Note: I had to use sudo apt-get install git-lfs rather than sudo apt install git-lfs specified in the instructions.
Copy and past the code I provided in the What did you do? section and run the code.


README: fix the Download Docker link

Remove extra space between the link text and URL to make it render correctly in Markdown.
Fixes: 7a779b83f82f ("chore: update readme with docker version and url to docs")

A trivial issue I found while reading the docs.  Hope that helps!

Thanks! every bit/byte helps :)


The package org.tensorflow.lite.nnapi  does not exist

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template
System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow):
OS Platform and Distribution：Ubuntu 16.04:
Mobile device：Pixel 2
TensorFlow installed from：source
TensorFlow version:1.13.1
Python version:3.6
Bazel version :0.24.1

Describe the current behavior
when i run the demo which in https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/java/demo
so ,I found the bug,don't have  org.tensorflow.lite.nnapi

Excuse me, how long will this nnapi package be completed in org.tensorflow:tensorflow-lite:0.0.0-nightly?

@wcq19941215 Could you provide more details about the bug and context? Also, it would be great if you can provide any commands you followed. Please provide as many details as possible to resolve the issue faster. Thanks!

@gadagashwini .The detail about bug in https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/java/demo/app/src/main/java/com/example/android/tflitecamerademo/ImageClassifier.java
and the code is:
import org.tensorflow.lite.nnapi.NnApiDelegate;
but I can't find the pack in org.tensorflow:tensorflow-lite-gpu:0.0.0-nightly or org.tensorflow:tensorflow-lite:0.1.2-nightly
so ,i used bazel ,want to get a new tensorflowlite aar , of course ,i can get a org.tensorflow.lite.nnapi.NnApiDelegate but it don't work
the bazel command i used is:
bazel build --cxxopt='--std=c++11' -c opt
--config=android_arm --config=monolithic
//tensorflow/lite/java:tensorflow-lite-with-select-tf-ops
Thanks for your help.^v^

Facing same issue in the tflite demo app (tflite-gpu-nightly)...

@anilsathyan7 Have you solved this problem?

Thanks for flagging the issue, this is an issue with how sources are aggregated in the aar that gets uploaded. We'll have it fixed in the night TFLite nightly (org.tensorflow:tensorflow-lite:0.0.0-nightly).

@jdduke That ‘means you will add org.tensorflow.lite.nnapi to  org.tensorflow:tensorflow-lite:0.0.0-nightly no long?Thanks for your help

Facing same issue in the tflite demo app (tflite-gpu-nightly)...
error: org.tensorflow.lite.nnapi does not exist
错误: 程序包org.tensorflow.lite.nnapi不存在

@chenjiaoAngel You can try to compile a local AAR yourself. I tried it and successfully compiled lite.nnapi aar , but it can't work. It should be caused by conflict with other packages.

Hi, thank you!
SO the final solution is ? And how to build the local AAR ?
Best wishes,
Jiao
Tel: +8618101358192
Email: chenjiao04<EMAIL_ADDRESS>BaiduHi: AngelCJ
Baidu
SYS
发件人: wcq19941215<EMAIL_ADDRESS>答复: tensorflow/tensorflow<EMAIL_ADDRESS>日期: 2019年6月11日 星期二 下午4:03
收件人: tensorflow/tensorflow<EMAIL_ADDRESS>抄送: "Chen,Jiao(SYS)"<EMAIL_ADDRESS>Mention<EMAIL_ADDRESS>主题: Re: [tensorflow/tensorflow] The package org.tensorflow.lite.nnapi does not exist (#28585)
@chenjiaoAngelhttps://github.com/chenjiaoAngel You can try to compile a local AAR yourself. I tried it and successfully compiled lite.nnapi aar , but it can't work. It should be caused by conflict with other packages.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/tensorflow/tensorflow/issues/28585?email_source=notifications&email_token=AJG4D2HRB4EY6JORJ72JBVTPZ5L5DA5CNFSM4HMASMUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXMIUGY#issuecomment-500730395, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AJG4D2H3CL37SPBDGIIL22LPZ5L5DANCNFSM4HMASMUA.

@chenjiaoAngel if you want to compile a local AAR ,you will use bazel.Finally, I did not solve this problem because there are other things that have been delayed.But I think that the latest aar package should have solved this problem, just need to update it in the AS.

The NNAPI delegate is in the latest TFLite nightly @ org.tensorflow:tensorflow-lite:0.0.0-nightly. The GPU delegate is in a separate .aar, and should be used in addition to the core TFLite nightly. Add org.tensorflow:tensorflow-lite-gpu:0.0.0-nightly to your dependencies. Note that you might need to clear your gradle cache for the new class to be visible.

@jdduke Thanks,It can work

Since gradle automatically caches a copy of it while downloading it, gradle actually reloads the local cache when clean project
.SO the final solution is delete the ".gradle/caches/" ,and rebuild project.
On Windows: %USER_HOME%.gradle/caches/
On Mac/Unix: $HOME/.gradle/caches/


examples should use CLI, not argparse

and this is what you can use for so called "choice" parameters : http://click.pocoo.org/5/options/#basic-value-options
I thought about this when I saw the option --noazimuth in the TTI example
potentially work for the UROP

Not sure why this is better

Should I incoroporate this in #1257 ?

From issues that popped up with ltest click version, the opposite may have to be considered for future stability and replacing back click options by arg_parse. See #1832

In retrospect, I agree

updating title to reflect


"TypeError: cannot deepcopy this pattern object" when there is a Widget with a compiled regular expression attribute

Version: 1.0.1
Cause: #550
Widget:
class SpreadsheetPhoneFixWidget(Widget):
    def __init__(self):
        **self.regexp = re.compile("^(\d{2})(\d{3})(\d{2})(\d{2})$")**

    def clean(self, value, row=None):
        try:
            return "0" + " ".join(self.regexp.match(value).groups())
        except AttributeError:
            return value

Traceback:
Traceback (most recent call last):
  File ".../venv/lib/python3.5/site-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File ".../venv/lib/python3.5/site-packages/django/utils/decorators.py", line 110, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File ".../venv/lib/python3.5/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File ".../venv/lib/python3.5/site-packages/django/contrib/admin/sites.py", line 233, in inner
    return view(request, *args, **kwargs)
  File ".../venv/lib/python3.5/site-packages/import_export/admin.py", line 241, in import_action
    resource = self.get_import_resource_class()(**self.get_import_resource_kwargs(request, *args, **kwargs))
  File ".../venv/lib/python3.5/site-packages/import_export/resources.py", line 201, in __init__
    self.fields = deepcopy(self.fields)
  File "/usr/lib/python3.5/copy.py", line 182, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "/usr/lib/python3.5/copy.py", line 320, in _reconstruct
    value = deepcopy(value, memo)
  File "/usr/lib/python3.5/copy.py", line 182, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "/usr/lib/python3.5/copy.py", line 297, in _reconstruct
    state = deepcopy(state, memo)
  File "/usr/lib/python3.5/copy.py", line 155, in deepcopy
    y = copier(x, memo)
  File "/usr/lib/python3.5/copy.py", line 243, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib/python3.5/copy.py", line 182, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "/usr/lib/python3.5/copy.py", line 297, in _reconstruct
    state = deepcopy(state, memo)
  File "/usr/lib/python3.5/copy.py", line 155, in deepcopy
    y = copier(x, memo)
  File "/usr/lib/python3.5/copy.py", line 243, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib/python3.5/copy.py", line 166, in deepcopy
    y = copier(memo)

Workaround: do not compile regex patterns or move them out of Widgets.

Should I add a test or will it be added to docs as a limitation?

Yes, looks like a note would do, thank you. I'll close this if you don't mind, as this discussion must be relatively easy to find for those few who encounter this issue.


New arguments to CLI

--prefercoverfile use cover.jpeg (or cover.png) as the cover instead of the first item on the folder
--nocoveraspage deletes the image selected to be a cover so it doesn't become a page inside the book. Useful when the epub reader shows the cover as the first page
--author allows you to name the author yourself

--nocoveraspage probably fixes this https://github.com/ciromattia/kcc/issues/557

Related #433

Out of curiosity we're you testing on a Kobo? @resendeBruno

Could prefer cover just be the default behavior instead of an option?
Can remove cover be a gui option too? We've upgraded to qt6.