Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubunutu/Debian start script #51

Open
RaspyVotan opened this issue Sep 17, 2017 · 3 comments
Open

Ubunutu/Debian start script #51

RaspyVotan opened this issue Sep 17, 2017 · 3 comments

Comments

@RaspyVotan
Copy link

How is morty supposed to run on Debian/Ubuntu? Some more details on suggested setup would be helpful:

  • Should it run on a different user?
  • Start with a systemd script? Maybe a template would be great (I am no expert on startup scripts)
  • How do I see if this works? Is there some debugging option that shows if searx works with morty?
    Appreciate your time,
    RaspyVotan
@rev138
Copy link

rev138 commented Dec 14, 2017

In general, if a process doesn't need root privileges, it shouldn't run as root, so it's best to create a 'morty' user to run it as. My systemd service looks like this:

[Unit]
Description=morty proxy

[Service]
User=morty
Group=morty
Environment="GOROOT=/usr/local/go"
Environment="GOPATH=/srv/golang"
Environment="PATH=$GOROOT/bin:$GOPATH/bin:$PATH"
ExecStart=/srv/golang/bin/morty -ipv6 -key ***redacted***

[Install]
WantedBy=multi-user.target

Of course you'll need to adjust your paths.

@josch
Copy link
Contributor

josch commented Mar 31, 2018

For the package that I uploaded to Debian, I'm including the following .service file:

[Unit]
Description=morty proxy
Documentation=man:morty(1)

[Service]
User=morty
Group=morty
ExecStart=/usr/bin/morty -listen 127.0.0.1:3000

[Install]
WantedBy=multi-user.target

I don't pass a key because morty listens on localhost only by default (but I made it explicit anyways) and thus authentication should not be required. Only local services can acces the proxy anyway if it doesn't bind to a public address.

Morty could ship its own version of the .service file but I guess setting GOROOT and GOPATH is required when installing go packages in a custom path? The environment variables are definitely not required for morty from the Debian package.

@josch
Copy link
Contributor

josch commented Apr 1, 2018

For the package that I uploaded to Debian, I'm including the following .service file:

[Unit]
Description=morty proxy
Documentation=man:morty(1)

[Service]
User=morty
Group=morty
ExecStart=/usr/bin/morty -listen 127.0.0.1:3000

[Install]
WantedBy=multi-user.target

I don't pass a key because morty listens on localhost only by default (but I made it explicit anyways) and thus authentication should not be required. Only local services can acces the proxy anyway if it doesn't bind to a public address.

Morty could ship its own version of the .service file but I guess setting GOROOT and GOPATH is required when installing go packages in a custom path? The environment variables are definitely not required for morty from the Debian package.

The original poster asked how morty is supposed to run on Debian/Ubuntu. This question should be solved once morty clears the NEW queue (and thus will appear in Debian proper) or once Ubuntu imports all packages from Debian unstable again (and thus will appear in Ubuntu proper).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants