<commit_before>{ config, lib, pkgs, serverInfo, php, ... }:

with lib;

let

  httpd = serverInfo.serverConfig.package;

  version24 = !versionOlder httpd.version "2.4";

  allGranted = if version24 then ''
    Require all granted
  '' else ''
    Order allow,deny
    Allow from all
  '';

  owncloudConfig = pkgs.writeText "config.php"
    ''
      <?php

      /* Only enable this for local development and not in productive environments */
      /* This will disable the minifier and outputs some additional debug informations */
      define("DEBUG", false);

      $CONFIG = array(
      /* Flag to indicate ownCloud is successfully installed (true = installed) */
      "installed" => true,

      /* Type of database, can be sqlite, mysql or pgsql */
      "dbtype" => "${config.dbType}",

      /* Name of the ownCloud database */
      "dbname" => "${config.dbName}",

      /* User to access the ownCloud database */
      "dbuser" => "${config.dbUser}",

      /* Password to access the ownCloud database */
      "dbpassword" => "${config.dbPassword}",

      /* Host running the ownCloud database. To specify a port use "HOSTNAME:####"; to specify a unix sockets use "localhost:/path/to/socket". */
      "dbhost" => "${config.dbServer}",

      /* Prefix for the ownCloud tables in the database */
      "dbtableprefix" => "",

      /* Force use of HTTPS connection (true = use HTTPS) */
      "forcessl" => ${config.forceSSL},

      /* Blacklist a specific file and disallow the upload of files with this name - WARNING: USE THIS ONLY IF YOU KNOW WHAT YOU ARE DOING. */
      "blacklisted_files" => array('.htaccess'),

      /* The automatic hostname detection of ownCloud can fail in certain reverse proxy and CLI/cron situations. This option allows to manually override the automatic detection. You can also add a port. For example "www.example.com:88" */
      "overwritehost" => "${config.overwriteHost}",

      /* The automatic protocol detection of ownCloud can fail in certain reverse proxy and CLI/cron situations. This option allows to manually override the protocol detection. For example "https" */
      "overwriteprotocol" => "${config.overwriteProtocol}",

      /* The automatic webroot detection of ownCloud can fail in certain reverse proxy and CLI/cron situations. This option allows to manually override the automatic detection. For example "/domain.tld/ownCloud". The value "/" can be used to remove the root. */
      "overwritewebroot" => "${config.overwriteWebRoot}",

      /* The automatic detection of ownCloud can fail in certain reverse proxy and CLI/cron situations. This option allows to define a manually override condition as regular expression for the remote ip address. For example "^10\.0\.0\.[1-3]$" */
      "overwritecondaddr" => "",

      /* A proxy to use to connect to the internet. For example "myproxy.org:88" */
      "proxy" => "",

      /* The optional authentication for the proxy to use to connect to the internet. The format is: [username]:[password] */
      "proxyuserpwd" => "",

      /* List of trusted domains, to prevent host header poisoning ownCloud is only using these Host headers */
      'trusted_domains' => array('${config.trustedDomain}'),

      /* Theme to use for ownCloud */
      "theme" => "",

      /* Optional ownCloud default language - overrides automatic language detection on public pages like login or shared items. This has no effect on the user's language preference configured under "personal -> language" once they have logged in */
      "default_language" => "${config.defaultLang}",

      /* Path to the parent directory of the 3rdparty directory */
      "3rdpartyroot" => "",

      /* URL to the parent directory of the 3rdparty directory, as seen by the browser */<commit_msg>owncloud httpd-service: fix trusted_domain when unset<commit_after>{ config, lib, pkgs, serverInfo, php, ... }:

with lib;

let

  httpd = serverInfo.serverConfig.package;

  version24 = !versionOlder httpd.version "2.4";

  allGranted = if version24 then ''
    Require all granted
  '' else ''
    Order allow,deny
    Allow from all
  '';

  owncloudConfig = pkgs.writeText "config.php"
    ''
      <?php

      /* Only enable this for local development and not in productive environments */
      /* This will disable the minifier and outputs some additional debug informations */
      define("DEBUG", false);

      $CONFIG = array(
      /* Flag to indicate ownCloud is successfully installed (true = installed) */
      "installed" => true,

      /* Type of database, can be sqlite, mysql or pgsql */
      "dbtype" => "${config.dbType}",

      /* Name of the ownCloud database */
      "dbname" => "${config.dbName}",

      /* User to access the ownCloud database */
      "dbuser" => "${config.dbUser}",

      /* Password to access the ownCloud database */
      "dbpassword" => "${config.dbPassword}",

      /* Host running the ownCloud database. To specify a port use "HOSTNAME:####"; to specify a unix sockets use "localhost:/path/to/socket". */
      "dbhost" => "${config.dbServer}",

      /* Prefix for the ownCloud tables in the database */
      "dbtableprefix" => "",

      /* Force use of HTTPS connection (true = use HTTPS) */
      "forcessl" => ${config.forceSSL},

      /* Blacklist a specific file and disallow the upload of files with this name - WARNING: USE THIS ONLY IF YOU KNOW WHAT YOU ARE DOING. */
      "blacklisted_files" => array('.htaccess'),

      /* The automatic hostname detection of ownCloud can fail in certain reverse proxy and CLI/cron situations. This option allows to manually override the automatic detection. You can also add a port. For example "www.example.com:88" */
      "overwritehost" => "${config.overwriteHost}",

      /* The automatic protocol detection of ownCloud can fail in certain reverse proxy and CLI/cron situations. This option allows to manually override the protocol detection. For example "https" */
      "overwriteprotocol" => "${config.overwriteProtocol}",

      /* The automatic webroot detection of ownCloud can fail in certain reverse proxy and CLI/cron situations. This option allows to manually override the automatic detection. For example "/domain.tld/ownCloud". The value "/" can be used to remove the root. */
      "overwritewebroot" => "${config.overwriteWebRoot}",

      /* The automatic detection of ownCloud can fail in certain reverse proxy and CLI/cron situations. This option allows to define a manually override condition as regular expression for the remote ip address. For example "^10\.0\.0\.[1-3]$" */
      "overwritecondaddr" => "",

      /* A proxy to use to connect to the internet. For example "myproxy.org:88" */
      "proxy" => "",

      /* The optional authentication for the proxy to use to connect to the internet. The format is: [username]:[password] */
      "proxyuserpwd" => "",

      /* List of trusted domains, to prevent host header poisoning ownCloud is only using these Host headers */
      ${if config.trustedDomain != "" then "'trusted_domains' => array('${config.trustedDomain}')," else ""}

      /* Theme to use for ownCloud */
      "theme" => "",

      /* Optional ownCloud default language - overrides automatic language detection on public pages like login or shared items. This has no effect on the user's language preference configured under "personal -> language" once they have logged in */
      "default_language" => "${config.defaultLang}",

      /* Path to the parent directory of the 3rdparty directory */
      "3rdpartyroot" => "",

      /* URL to the parent directory of the 3rdparty directory, as seen by the browser */
{'fraction_non_alphanumeric': 0.10931385337855466, 'fraction_numerical': 0.004956952778502478, 'mean_word_length': 3.084709643047416, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '935371', 'n_tokens_mistral': 2027, 'n_tokens_neox': 1921, 'n_words': 849}