How to correctly setup google domains et google cloud DNS to get certbot (Let’s Encrypt) running

I have a small server at home running TrueNas with a couple of jails. I created a jail to host the reverse proxy, nginx, to reach one of my jails, git, from the outside. I am trying to follow this tutorial and I do want to implement https. However, certbot doesn’t work with Google Domain directly but with the Google Cloud DNS API. After trying different things, I am missing the correct setup on both Google Domain and Google Cloud DNS to make certbot work and deliver the https certificates.

I own the domain name scheltienne.net through google domain. I am trying to make my jail git running gitea accessible to the address git.scheltienne.net.

On Google Cloud, I created a project, a service account with the correct permissions for certbot, and a DNS zone. Under Google Cloud DNS the created zone is:

google cloud dns

On Google Domain, I have disabled DNSSEC and set the name servers to custom name servers, matching the name servers of the zone in Google Cloud DNS.

ns-cloud-c1.googledomains.com
ns-cloud-c2.googledomains.com
ns-cloud-c3.googledomains.com
ns-cloud-c4.googledomains.com

I believe that up to this point, I did not make a mistake. Show me how wrong I am 😉

Now, I am very confused as to which step I should take from here. I thought I have to create a record of some type under the zone to map the address git.scheltienne.net to my nginx jail, but I can’t figure out the type of record and the IP address to provide.

Moreover, the second confusing point for me is the Dynamic DNS. My home network has a dynamic IP address. On Google Domain, I have a Synthetic record created with a subdomain (e.g. test.scheltienne.net) which gave me credentials to plug into the client service on TrueNas to communicate my IP address to Google. 1. Is this DynamicDNS Synthetic record still working despite having the name server changed to the custom name servers; 2. How can I set records pointing to the dynamic address instead of a static IPv4 address (record A)?

Thank you for the guidance, I am very lost..

javascript – How to pass tests correctly in Typescript?

The problem:

I’m trying to write a TypeScript function suitable for a previously written JEST test. There are 5 tests in total. The function I wrote passes all the tests, but unfortunately, I was asked to write again in the review. How to write this more efficiently?

Example case:
Imagine an array that contains folders. These folders can have files in it. move function moves a file to another folder and returns the new state of given list.

Example list:


const list = (
  {
    id: '1',
    name: 'Folder 1',
    files: (
      { id: '2', name: 'File 1' },
      { id: '3', name: 'File 2' },
      { id: '4', name: 'File 3' },
      { id: '5', name: 'File 4' },
    ),
  },
  {
    id: '6',
    name: 'Folder 2',
    files: ({ id: '7', name: 'File 5' }),
  },
) 

If I run move(list, ‘4’, ‘6’) then I expect file with id 4 moved to the folder which has id 6. Function should return the new state below;


const result = (
  {
    id: '1',
    name: 'Folder 1',
    files: (
      { id: '2', name: 'File 1' },
      { id: '3', name: 'File 2' },
      { id: '5', name: 'File 4' },
    ),
  },
  {
    id: '6',
    name: 'Folder 2',
    files: (
      { id: '7', name: 'File 5' },
      { id: '4', name: 'File 3' },
    ),
  },
)

move.ts

type File = {
  id: string;
  name: string;
};

type Folder = {
  id: string;
  name: string;
  files: File();
};

type List = Folder();

export default function move(list: List, source: string, destination: string): List {
  let sourceFileIndex = -1;
  let sourceFolderIndex = -1;
  let destinationFolderIndex = -1;

  for (let i = 0; i < list.length; i += 1) {
    const { id, files } = list(i);

    if (id === source) {
      throw new Error('You cannot move a folder');
    }

    if (id === destination) {
      destinationFolderIndex = i;
    }

    if (destinationFolderIndex > -1 && sourceFileIndex > -1) break;

    for (let j = 0; j < files.length; j += 1) {
      if (files(j).id === destination) {
        throw new Error('You cannot specify a file as the destination');
      }

      if (files(j).id === source) {
        sourceFileIndex = j;
        sourceFolderIndex = i;
        break;
      }
    }
  }

  if (destinationFolderIndex === -1) {
    throw new Error('Given destination id did not match any folder');
  }

  if (sourceFolderIndex === -1) {
    throw new Error('Given source id of file was not found in any folder');
  }

  list(destinationFolderIndex).files.push(
    ...list(sourceFolderIndex).files.splice(sourceFileIndex, 1),
  );

  return list;
}

move.spec.ts

import move from './move';

describe('move', () => {
  it('moves given file to another folder', () => {
    const list = (
      {
        id: '1',
        name: 'Folder 1',
        files: (
          { id: '2', name: 'File 1' },
          { id: '3', name: 'File 2' },
          { id: '4', name: 'File 3' },
          { id: '5', name: 'File 4' },
        ),
      },
      {
        id: '6',
        name: 'Folder 2',
        files: ({ id: '7', name: 'File 5' }),
      },
    );

    const result = (
      {
        id: '1',
        name: 'Folder 1',
        files: (
          { id: '2', name: 'File 1' },
          { id: '3', name: 'File 2' },
          { id: '5', name: 'File 4' },
        ),
      },
      {
        id: '6',
        name: 'Folder 2',
        files: (
          { id: '7', name: 'File 5' },
          { id: '4', name: 'File 3' },
        ),
      },
    );

    expect(move(list, '4', '6')).toStrictEqual(result);
  });

  it('throws error if given source is not a file', () => {
    const list = (
      {
        id: '1',
        name: 'Folder 1',
        files: ({ id: '2', name: 'File 1' }),
      },
      { id: '3', name: 'Folder 2', files: () },
    );

    expect(() => move(list, '3', '1')).toThrow('You cannot move a folder');
  });

  it('throws error if given destination is not a folder', () => {
    const list = (
      {
        id: '1',
        name: 'Folder 1',
        files: ({ id: '2', name: 'File 1' }),
      },
      { id: '3', name: 'Folder 2', files: ({ id: '4', name: 'File 2' }) },
    );

    expect(() => move(list, '2', '4')).toThrow('You cannot specify a file as the destination');
  });

  it('throws error if given source was not found', () => {
    const list = (
      {
        id: '1',
        name: 'Folder 1',
        files: (
          { id: '2', name: 'File 1' },
          { id: '3', name: 'File 2' },
          { id: '4', name: 'File 3' },
          { id: '5', name: 'File 4' },
        ),
      },
      {
        id: '6',
        name: 'Folder 2',
        files: ({ id: '7', name: 'File 5' }),
      },
    );

    expect(() => move(list, '9', '6')).toThrow(
      'Given source id of file was not found in any folder',
    );
  });

  it('throws error if given destination was not found', () => {
    const list = (
      {
        id: '1',
        name: 'Folder 1',
        files: (
          { id: '2', name: 'File 1' },
          { id: '3', name: 'File 2' },
          { id: '4', name: 'File 3' },
          { id: '5', name: 'File 4' },
        ),
      },
      {
        id: '6',
        name: 'Folder 2',
        files: ({ id: '7', name: 'File 5' }),
      },
    );

    expect(() => move(list, '4', '9')).toThrow('Given destination id did not match any folder');
  });
});


As I said, it passed 5 tests but was not accepted. What is the problem?

domain name system – How to configure DNS records correctly?

I’ve got app on GCP up and running. I can view the app after typing its external IP so I know
the app works fine.

Now I’m trying to point domain purchased on Godaddy to it. After following a tutorial I got 404 from the browser.

cloud DNS zone:

cloud DNS zone screenshot

Godaddy DNS records for the domain:
enter image description here
enter image description here

According to tutorial after taking these steps I should be able to access my app after typing the domain in. I’m getting 404.

Any help is much appreciated.

I use reactjs and Google does not index all the contents of my site completely and correctly

google dose not index my site totlly: Is it due to coding or server side? i use react js
and for server side rendering, we use next js.

this pic is screen shot of google from my site
enter image description here

and this is a real screen shot from my site:
enter image description here

and this pic is result of gtmetrix website that is correct:
enter image description here

Does Google index all the content of a site?
how can i check server side rendering is working correctly?
can you help me please?

Materials aren’t loading correctly from SketchUp into Unity

I imported a SketchUp COLLADA (.dae) file from 2017 SketchUp Make, and imported it into Unity. I then clicked “Use External Materials” and the colors began to load. But I noticed quickly that one of the wings of my imported B-29 was Dark Gray, while the other way a proper color. Random parts, such as the front engine housing piece, were also dark gray. Parts of my advanced dials were also dark gray, and I immediately decided that there is now ay that I am going to manually go in and fix every single dark-gray material, but at the moment, I found no alternative.

I began with the wing. I went to assign the material that I used for the other wing, which was white, to the dark gray wing, but I found out that the other wing already had that material in use. And when I went to assign a different white color, absolutely nothing changed, aside from the fact that the wing now claimed that it had that color in use. Is there a fix for this problem? I could try importing as a .SKP file, if the reason for the issue is something to do with the COLLADA (.dae) file.

What I had was 2 wings. they were both components in SketchUp, so whatever I did to one applied to the other, Then I made them unique before importing to Unity. The Wing that won’t work right is the one wing that had the USAF Insignia on it. But I doubt this is the problem, because all engines on that wing were also not colored correctly, whereas the other wing was fine. Those engines were also components, but were also made unique before the import.

Each wing has 9 groups inside of it. The other wing is identical in this sense. I imported the file from file explorer by dragging the file from file explorer and dropping it into unity.

This is what the plane looks like in Unity:
Incorrectly-Colored B-29

My apologies for the crude handwriting, it is difficult to draw with a touchpad.
In the image, I numbered the incorrectly-colored parts visible in the image (Right/Left references are perspective to image)

1. Left Wing. Color: Dark gray. Color intended: White.

2. Propeller blade hub. This is the part that all propeller blades are connected to. Both hubs on the two propellers on the Left Wing are colored incorrectly. Color: white. Color Intended: Grey.

3. Pistons. All piston components, such as the pistons, securing poles, and piston heads are not colored correctly; same on the other engine on the Left Wing. Color: White. Color Intended: Grey pistons, darkish-grey piston heads, and copper-orange securing poles.

4. Cowl Flaps. In the image, this appears to be a stripe in the engine. Same with the other cowl flaps on the other engine on the Left Wing. Color: Dark gray. Color Intended: White.

5. Propeller blades. All 4 propeller blades on both engines on the left wing are not colored correctly. Color: White. Color Intended: Black, with yellow tips.

6. Right-Wing Pistons. Most piston components, such as the pistons heads and securing poles are not colored correctly. Same with the other engine on the Right Wing. Color: White Piston Heads, Grey Pistons, Almost-Black Gray in the lines on the pistons, white securing poles. Color Intended: Grey pistons, darkish-grey piston heads, and copper-orange securing poles.

7. Front Engine Casing. The same error is in the other engine’s front engine casing on the Right Wing. Color: Dark Gray, with an apparent shine coming from beneath the part, which shouldn’t be happening (the directional light is above the engine part). Color Intended: White.

8. Rear Engine Casing. The same error is in the other engine’s rear engine casing on the Right Wing. Color: Dark Gray, with an apparent shine coming from beneath the part, which shouldn’t be happening (the directional light is above the engine part). Color Intended: White.

nginx – Ensuring Redirects on a Proxied Server work correctly

So I am currently trying to understand what configuration is a good idea for an nginx proxy. I am a bit stuck on the following two options:

  • proxy_set_header Host $host;
  • proxy_redirect default; (which is the default anyway and thus superflous)

If I understand it correctly then they both seem to target the same goal: ensuring that redirect work correctly. Setting the header variable Host to $host (which is the name of the nginx server, while the default ($proxy_host) is the name of the proxy server), ensures that the proxy server “views itself as $host” and thus links paths of type /some/sub/path to resources at $host/some/sub/path instead of $proxy_host/some/sub/path.

But this seems to be the purpose proxy_redirect is for as well. So I am not sure what to make of this. Maybe I am not really understanding those parameters quite right.

How can digital signatures assure the sender their message has been correctly received?

PKI ensure that if the message reaches its destination it has not been altered (if signed with sender private key) and/or has not be compromissed (if crypted with recipient public key).

If the sender wants to make sure that the recipient has actually received the message, a higher level protocol must be used. For example the recipient could send a signature of the original (optionaly decrypted) message using their private key. So if the round trip:

A -> message signed with A private key -> B
A <- signature of the original message with B private key <- B

completes, then A can be sure that B has received the correct message.

If you do not set up that round trip, even with modern system where the sender can be sure that the message reaches the recipient system, you have no protection against the message being destroyed between its arrival on a machine and the moment when the human being named B could read it.

This would be more or less an implementation of what was the QSL in the early days of radio frequency message (mainly using Morse code). BTW that QSL was still in use in the 80’s to ensure that a message had been received and understood (*): until the sender had not received a QSL to message number xxx they periodically try to send it again or try a phone call to know whether the recipient system was off or out of use (at least at French Met Office).


(*) as QSL to message … had to be manually sent, it meant that somebody could read the message number and declared having understanded the full message.

magento 2.4.2 updated get The store will not work correctly in the case when cookies are disabled

When I upgraded my webiste from M2.3.5 to M2.4.2, I get this notice “The store will not work correctly in the case when cookies are disabled.” on top of head frontend for 3 seconds. But I installed a new M2.4.2 have not get that notice(Cookie Restriction Mode = No) . I found div id named “cookie status” The store will not work correctly in the case when cookies are disabled. but I can’t find which file can control this. I don’t need the notice display, so how to do that? Thanks

enter image description here

enter image description here

enter image description here

sparse arrays – How to write correctly some arguments in SparseArray

I am struggling to put an argument in SparseArray. Let’s consider the following example

dim = 9;
s = SparseArray({{i_, i_} :> 1.0 + I, Band({2, 1}) -> 2.0, 
   Band({1, 2}) -> 2.0}, {dim, dim}, 0.0)

This works correctly and generates a matrix 9×9 with two diagonals having the value 2.0. Now I want to change some values on one of those diagonals, or better said, when I define s I would like to have a different value of 2.0 but only on some certain positions of that diagonal. For that I use an array lt specifying those positions in s,
lt={3,6};, because one can specify manually a value for a certain position (for example {1,1}->4.0) and I tried to put the following Row(Flatten(Table({i,i+1}->0.0,{i,lt}),1),","), having

s = SparseArray({{i_, i_} :> 1.0 + I,Row(Flatten(Table({i, i + 1} -> 0.0, {i, lt}), 1), ","), Band({2, 1}) -> 2.0, 
   Band({1, 2}) -> 2.0}, {dim, 
   dim}, 0.0)

but it failed, but If I put manually the positions

s = SparseArray({{i_, i_} :> 1.0 + I,{3,4}->0.0,{6,7}->0.0, Band({2, 1}) -> 2.0, 
   Band({1, 2}) -> 2.0}, {dim, 
   dim}, 0.0)

it works. Of course this example is small and I can write it manually, but in real nb dimensions are bigger, that is why I use a Table command. Maybe the question could be also seen as how to obtain the output of Table without {}. Any advice is welcome.

user – SharePoint Online and Flows – how to remove quitted employee correctly?

I created flow that uses “Grant permissions” action, and it uses SharePoint Group with users. One of employees has left the company, and (as I understand) IT Team deleted this account. But this user was still in SharePoint Group so my flow got his email and crashed on “Grant permissions” step:

cannot resolve user jane.doe@company.com

So all my approval instances created yesterday crashed.
As I suppose IT Team should not delete user, but reset password and disable(?). Imho we need to keep users for audit/project management history..

What is correct procedure of removing resigned user in Microsoft 365? Do You have any best-practices or what do You use?