Regarding GatewayST Setup

Hi,
I’m migrating my pixelfed instance to a new server. As a part of the migration process I’m setting up GatewayST on my new server.

I generated an api key and followed exact same steps mentioned in the docs.

Gateway is running without any issues.

But the problem occured when I tried to created a systemd service and run the gateway in website mode.

Here’s my config:

Here’s what I get after “systemctl status gateway”:

And.

I was using the default access found in the config.yaml …

Regarding access grants…
Can I use my own access grant (generated by me) in the config.yaml ?

Or I have to generate the key from satellite UI ?

I dont understand this part.

Thanks :blush:

You need to setup your gateway anyway.
For example, like this:

$ gateway setup --non-interactive --access 1cCYertoijhgoiogtjgfhtrhmrohjbokgfmnvbortmbrtkhjriotobmjiotyhbt....

After that you can run it:

$ gateway run

and you will see the access key and secret key in the log output.

For root, you just need to do that as root.
The needed file is ~/.local/share/storj/gateway/config.yaml (for root it will be /root/.local/share/storj/gateway/config.yaml), which contain

# the serialized access, or name of the access to use
access: 1cCYertoijhgoiogtjgfhtrhmrohjbokgfmnvbortmbrtkhjriotobmjiotyhbt....

If you do not plan to change the access grant too often, you may just setup it once and hardcode resulted S3 creds in your app.

1 Like

Is there any problem with the interactive setup ? I followed that !
Do I need to revert back ?

/root/.local/share/storj/gateway/

I’m not seeing any config file here …

Am I supposed to use the access key from my previous setup ?

I have backed up my previous access grant that was generated while setting up GatewayST (Interactive)

You may reuse it of course, just run a setup as root (or copy your config to the root home folder, or provide a path to the config file in the gateway run command with --config-dir option).
Just gateway run uses parameters from config.yaml and seems ignore your --access option…

1 Like

Got it ! Created a new access grant from satellite dashboard and ran gateway setup as root user (sudo). Now I can see the config file in both location.

By the way, I see telemetry is enabled. What information does it collect ? How can I disable telemetry?

It collect the usage statistics (not personalized), you may disable it with option tracing.enabled: false in your config.yaml (root one, if you run it as root), or with an argument --tracing.enabled=false in your gateway run command.

1 Like

Is the first one a error message ?

no. More like a warning - usually you should not run anything as root, it’s not safe.
It’s better to use a special limited user for that, especially when the service is not require any root access (like in this case).

1 Like

But if i dont run gateway as root. I get insecure-dev-key error

Because you need to have config.yaml for this user :slight_smile:

1 Like

Got it … There was a config file. It was created previously. I’m just gonna update the access key. Wont it work ?

I updated config.yaml for that user. But still getting that error. I think i have to run as root user (using sudo )

It will work even if you just copy the config.yaml file (just apply needed permissions).

1 Like

This is not possible, if you did it correctly and this user has an access to this file, remember - it’s looking for ~/.local/share/storj/gateway/config.yaml
So, if the user is USER, the path would be /home/USER/.local/share/storj/gateway/config.yaml
However, if you use sudo, it will looking for config for the root, i.e. /root/.local/share/storj/gateway/config.yaml

You can see, what is home dir for the used user:

sudo -iu USER echo "$HOME"
1 Like

Everything seems to be okay :+1:… Dunno what went wrong :confused:

1 Like

Is this okay ?

I think yes. Especially if it’s running :slight_smile:

1 Like