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

filtron: init at 0.2.0 #93181

Merged
merged 1 commit into from Aug 22, 2021
Merged

filtron: init at 0.2.0 #93181

merged 1 commit into from Aug 22, 2021

Conversation

dasj19
Copy link
Contributor

@dasj19 dasj19 commented Jul 15, 2020

Motivation for this change

I packaged filtron in order to protect a searx instance from bots and unwanted traffic.
I packaged its go dependencies as well.

The code I use to run filtron as a service:

  # Startup a filtron server.
  systemd.services.filtron-main = {
      wantedBy = [ "multi-user.target" ]; 
      after = [ "network.target" ];
      description = "Start a filtron instance.";
      serviceConfig = {
        User = "filtronm";
        ExecStart = ''
          ${pkgs.filtron}/bin/filtron -rules /etc/nixos/filtron-rules.json -target "127.0.0.1:8100"
        '';
      };
   };

My searx instance running as a service on port 8100 (I use a systemd service because I have two searx instances on the server)

  # Startup a main searx server.
  systemd.services.searx-main = {
      wantedBy = [ "multi-user.target" ]; 
      after = [ "network.target" ];
      description = "Start a main searx instance.";
      serviceConfig = {
        User = "searxm";
        ExecStart = ''
          ${pkgs.searx}/bin/searx-run
        '';
        Environment = [
          "SEARX_SETTINGS_PATH=/etc/nixos/searx-config.yml"
        ];         
      };
   };

Apache configuration:

  services.httpd.virtualHosts."searx.example".extraConfig = ''
    # Disable logs for privacy.
    SetEnvIf Request_URI "/" dontlog
    # Proxy addresses.
    ProxyPass / http://127.0.0.1:4004/
    ProxyPassReverse / http://127.0.0.1:4004/
  '';
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@dasj19
Copy link
Contributor Author

dasj19 commented Aug 10, 2020

CC'ing searx's maintainers for review: @matejc @fpletz @globin @danielfullmer
Thanks.

@danielfullmer
Copy link
Contributor

LGTM--It builds correctly for me, at least. I don't plan to use filtron myself, since my searx instance is private.

While a nixos module that works with the existing searx module would be nice, I don't think it should be required before merging.

Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please us buildGoModule.

@stale
Copy link

stale bot commented Jul 21, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 21, 2021
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 22, 2021
@dasj19 dasj19 changed the title filtron: init at 0.2.0 + go dependencies filtron: init at 0.2.0 Aug 22, 2021
@ofborg ofborg bot requested a review from kalbasit August 22, 2021 11:37
pkgs/servers/filtron/default.nix Outdated Show resolved Hide resolved

vendorSha256 = "05q2g591xl08h387mm6njabvki19yih63dfsafgpc9hyk5ydf2n9";

doCheck = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No tests? Please add a comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tried to fix the tests with a substituteInPlace but it requires much more work than I anticipated, so I marked upstream tests as obsolete and therefore I turned off the tests.

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

Successfully merging this pull request may close these issues.

None yet

3 participants