NetBox: Difference between revisions

imported>Jeyemwey
Simplify, reformat and remove postgres code
the configuration was in my opinion a little bit confusing. i got it to work with my done changes. i dont have an ssl intern at the moment so i cant do with ssl configuration. when i have one i will update these page
Line 13: Line 13:
</syntaxhighlight>
</syntaxhighlight>


 
===== Basic Configuration =====
==== Basic Configuration ====
The module will automatically setup a redis instance and a PostgreSQL database.<syntaxhighlight lang="nix">
 
<syntaxhighlight lang="nix">
{ config, ... }: {
{ config, ... }: {
  system.stateVersion = "24.05";


  networking.hostName = "netbox";
   networking.firewall.allowedTCPPorts = [ 80 ];
  networking.domain = "domain.tld";
   networking.firewall.allowedTCPPorts = [ 80 443 ];


   services.netbox = {
   services.netbox = {
Line 31: Line 26:
   services.nginx = {
   services.nginx = {
     enable = true;
     enable = true;
    user = "netbox";
     virtualHosts.<name> = {
    recommendedTlsSettings = true;
    clientMaxBodySize = "25m";
 
     virtualHosts."${config.networking.fqdn}" = {
       locations = {
       locations = {
         "/" = {
         "/" = {
Line 43: Line 34:
         "/static/" = { alias = "${config.services.netbox.dataDir}/static/"; };
         "/static/" = { alias = "${config.services.netbox.dataDir}/static/"; };
       };
       };
      forceSSL = true;
      enableACME = true;
      serverName = "${config.networking.fqdn}";
     };
     };
  };
  security.acme = {
    defaults.email = "acme@${config.networking.domain}";
    acceptTerms = true;
   };
   };
}  
}  
</syntaxhighlight>
</syntaxhighlight>


The module will automatically setup a redis instance and a PostgreSQL database. Your [[{{PAGENAME}}]] instance is now available at: https://netbox.domain.tld
<!--
==== small configuration ====
with some (working (and maybe non working)) plugins
<syntaxhighlight lang="nix">
</syntaxhighlight>
-->
<!--
== database ==
-->
<!--
== web server ==
-->
<!--
== accounts ==
: groups and privileges
==== LDAP ====
==== OpenID ====
==== OAuth ====
-->


=== Setup Superuser ===
=== Setup Superuser ===