class xreate_org( String $url, String $install_dir, String $db_user, String $secrets_dir, String $init_db, String $xreate_docs_path, String $doxy_docs_path, String $phabricator_ctl, String $init_repo, ){ $db_pass = file("${secrets_dir}mysql-pwd-${db_user}")[0, -2] $storage_dir = '/var/local/storage/' $backups_dir = '/var/local/backups/' $admin_user = 'xreate' #Defined in basics/init.pp! $group = 'phabricator' #Defined in basics/init.pp! include basics class {'phabricator::mysql': user => $db_user, password => $db_pass } class { 'phabricator': server_url => $url, secrets_dir => $secrets_dir, init_db =>$init_db, xreate_docs_path => $xreate_docs_path, ctl => $phabricator_ctl, #DB storage_upgrade_user => $db_user, storage_upgrade_password => $db_pass, #REPO init_repo => $init_repo, #USERS: admin_user => $admin_user, daemon_user => 'phabd', vcs_user => 'xreate-repo', www_user => 'www-data', group => $group, #URLS: arcanist_url => 'ssh://git@bitbucket.org/pgess/xreate-arcanist.git', phabricator_url => 'ssh://git@bitbucket.org/pgess/xreate-phabricator.git', libphutil_url => 'ssh://git@bitbucket.org/pgess/xreate-libphutil.git', xreate_docs_url => 'ssh://git@bitbucket.org/pgess/xreate-docs.git', #Path stored in DB: phabrcator_repository.repository.localPath repo_dir => '/var/local/repo/', storage_dir => $storage_dir, dumps_dir => '/var/local/dumps/', install_dir => $install_dir, logs_dir => '/var/log/xreate.org/', pid_dir => '/run/', install_fonts => false, manage_diffusion => true, config_hash => { #EMAIL: "metamta.default-address"=> "bot@xreate.org", "cluster.mailers" => [ { "key" => "xreate-mailer", "type" => "smtp", "options" => { "host"=> "smtp.zoho.com", "port"=> 465, "user" => "bot@xreate.org", "password" => "UeqiFxzkBdF1Ln0uwcTn", "protocol" => "ssl" } }], "phabricator.base-uri" => "http://${url}", "phabricator.tail-title" => "Xreate", "phabricator.show-prototypes" => true, "storage.default-namespace"=> "phabricator", 'storage.local-disk.path' => $storage_dir, 'mysql.host' => '127.0.0.1', 'mysql.user' => $db_user, 'mysql.pass' => $db_pass, #MODULES: 'load-libraries' => { 'xreate' => "${install_dir}/xreate-docs/src/" }, #DIFFUSION: 'diffusion.allow-http-auth' => true, #UI: 'ui.header-color' => 'dark', 'ui.logo' => { "logoImagePHID"=> null, "wordmarkText" => "Xreate" }, 'ui.footer-items'=> [ { "name"=> "Email: pr.h7@xreate.org" }, { "name"=> "2019 Xreate.org" }, { "name"=> "Powered by Phabricator" } ], 'phabricator.uninstalled-applications'=> { 'PhabricatorConpherenceApplication' => true, 'PhabricatorNuanceApplication' => true, 'PhabricatorPholioApplication' => true, 'PhabricatorAlmanacApplication' => true, 'PhabricatorBadgesApplication' => true, 'PhabricatorCalendarApplication' => true, 'PhabricatorChatLogApplication' => true, 'PhabricatorCountdownApplication' => true, 'PhabricatorDivinerApplication' => true, 'PhabricatorDrydockApplication' => true, 'PhabricatorFactApplication' => true, 'PhabricatorFlagsApplication' => true, 'PhabricatorFundApplication' => true, 'PhabricatorHarbormasterApplication' => true, 'PhabricatorHeraldApplication' => true, 'PhabricatorLegalpadApplication' => true, 'PhabricatorMacroApplication' => true, 'PhabricatorOwnersApplication' => true, 'PhabricatorPackagesApplication' => true, 'PhabricatorPhluxApplication' => true, 'PhabricatorPhortuneApplication' => true, 'PhabricatorPhragmentApplication' => true, 'PhabricatorPhrequentApplication' => true, 'PhabricatorPhurlApplication' => true, 'PhabricatorReleephApplication' => true, 'PhabricatorSlowvoteApplication' => true, 'PhabricatorTokensApplication' => true, 'PhabricatorMultimeterApplication' => true, 'PhabricatorPHPASTApplication' => true, 'PhabricatorUIExamplesApplication' => true, 'PhabricatorXHProfApplication' => true, 'PhabricatorOAuthServerApplication' => true } }, } #remove default NGINX sites $nginx_sites = "${nginx::params::conf_dir}/sites-enabled" file {"${nginx_sites}/default": ensure => absent } #Doxygen Documentation file{ $doxy_docs_path: ensure => 'directory', owner=>$phabricator::admin_user, group => $group; } nginx::resource::location{ '^~ /api': location_alias => "${doxy_docs_path}", index_files => ['index.html'], server => $xreate_org::url, } #Port redirects $redirects = hiera_hash('redirects',{}) notice($redirects) create_resources('basics::redir',$redirects) }