See mails sent from other application using gmail address - gmail

I have some self application that sends out automatic mails using my gmail address.
Is there an option for me to see the sent mails in the regular gmail interface (under 'sent' label)? right now I don't see them.
Thanks.
This is the configuration:
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => '****************.co.il',
'username' => '*************',
'password' => '***********',
'port' => '587',
'encryption' => 'tls',
],
],
This is the actual send:
Yii::$app->mailer->compose()
->setFrom('************#gmail.com')
->setTo($candidate->email)
->setSubject('Some subject')
->setTextBody('Some Body...')
->send();

Related

I cannot initialize Logstash 7.16. Unsupported SSL

Logstash 7.16. OpenSearch output plugin. Tarball.
Run:
./bin/logstash --path.settings /opt/logstash/config --verbose
Error message:
...
[ERROR][logstash.javapipeline ][fallback] Pipeline error {:pipeline_id=>"fallback", :exception=>#<Manticore::UnknownException: Unsupported or unrecognized SSL message>,
...
Output configuration file:
output {
opensearch {
hosts => [ "<IP>" ]
user => "user"
password => "password"
index => "%{[#metadata][beat]}-%{[#metadata][version]}-%{+YYYY.MM.dd}"
ssl => true
ssl_certificate_verification => false
cacert => "/opt/logstash/config/tls/root-ca.crt"
keystore => "/opt/logstash/config/tls/logstash-elasticsearch-output-client.p12"
keystore_password => "<passwd>"
}
}
Thanks for your attention

Connecting to vpn in Node js

I am trying to connect cisco vpn in Node js using cisco-vpn npm package.When i run the code it is getting failed.
const vpn = require('cisco-vpn')({
server: 'ipaddress',
username: 'username',
password: 'password'
})
vpn.connect()
.then(() => console.log('connected!')).catch(e => {
console.log("11",e)
})
// some time later
vpn.disconnect()
.then(() => console.log('disconnected!')).catch(e => {
console.log("17 is",e)
})

Puppet not creating grafana

When trying to run this code in my puppet-server - it complains on the port TCP 3000.
Error: /Stage[main]/Main/Grafana_datasource[prometheus]: Could not evaluate: Failed to open TCP connection to localhost:3000 (Connection refused - connect(2) for "localhost" port 3000)
class { 'grafana':
cfg => {
app_mode => 'production',
},
database => {
type => 'mysql',
host => '127.0.0.1:3306',
name => 'grafana',
user => 'root',
type => '',
},
users => {
allow_sign_up => false,
},
}
grafana_datasource { 'Prometheus':
grafana_url => 'http://localhost:3000',
grafana_user => 'admin',
grafana_password => 'grafanapw',
type => 'prometheus',
url => 'http://prom-ip:9090',
access_mode => 'proxy',
is_default => true,
require => Class['grafana'],
}
If I try to add this code into the class { 'grafana':}
It stops complaining - but no datasource is created
class { 'grafana':
cfg => {
server => {
http_port => 8080,
}
},
database => {
...
},
}
Overall the main issue is that grafana won't be created with a working datasource & dashboard(not shown here)
https://i.stack.imgur.com/MOz01.png
Grafana bind defaults to 3000. To use port 8080 you need to either give the Grafana binary:
$ sudo setcap 'cap_net_bind_service=+ep' /usr/sbin/grafana-server

LDAP Authentication for Apache using Puppet

I am currently setting up a reverse proxy in puppet so that I can authenticate using Active Directory.
I have the following in my puppet module.
class { 'apache::mod::ldap' :}
class { 'apache::mod::authnz_ldap' :}
apache::vhost { 'reverse-proxy':
port => '443',
docroot => '/var/www/html',
ssl => true,
ssl_cert => '/etc/httpd/ssl/cert.crt',
ssl_key => '/etc/httpd/ssl/cert.key',
require => [ File['/etc/httpd/ssl/cert.crt'], File['/etc/httpd/ssl/cert.key']],
rewrites => [
{
comment => 'Eliminate Trace and Track',
rewrite_cond => ['%{REQUEST_METHOD} ^(TRACE|TRACK)'],
rewrite_rule => [' .* - [F]'],
},
],
proxy_preserve_host => true,
proxy_pass => {
path => '/',
url => 'http://127.0.0.1:5601/',
},
directories => [
{
path => '/',
provider => 'location',
auth_name => 'Kibana Authentication',
auth_type => 'Basic',
auth_basic_provider => 'ldap',
auth_ldap_bind_dn => 'cn=serviceuser,ou=Users,dc=example,dc=com',
auth_ldap_bind_password => 'supersecretpassword',
auth_ldap_url => 'ldaps://ldap.example.com/dc=example,dc=com?CN?
sub?(objectClass=user)',
require => 'ldap-group
cn=application_users,ou=application_groups,ou=groups,dc=example,dc=com',
},
],
}
The problem I'm running into is that when I apply this configuration to my apache server auth_ldap_bind_dn, auth_ldap_bind_password, and auth_ldap_url are not being copied over. Puppet isn't throwing any errors and apache runs fine, but it isn't authenticating against LDAP.
old thread but for the benefit of anyone else with the same issue:
I've taken a look at the apache module's code in github and it doesn't appear to support the parameters you've mentioned (auth_ldap_bind_dn, auth_ldap_bind_password, and auth_ldap_url).
However, the directories resource allows you to include custom fragments, which you can use to inject any custom configuration outside of the apache module's scope into your config.
In your case, this should work:
class { 'apache::mod::ldap' :}
class { 'apache::mod::authnz_ldap' :}
apache::vhost { 'reverse-proxy':
port => '443',
docroot => '/var/www/html',
ssl => true,
ssl_cert => '/etc/httpd/ssl/cert.crt',
ssl_key => '/etc/httpd/ssl/cert.key',
require => [ File['/etc/httpd/ssl/cert.crt'], File['/etc/httpd/ssl/cert.key']],
rewrites => [
{
comment => 'Eliminate Trace and Track',
rewrite_cond => ['%{REQUEST_METHOD} ^(TRACE|TRACK)'],
rewrite_rule => [' .* - [F]'],
},
],
proxy_preserve_host => true,
proxy_pass => {
path => '/',
url => 'http://127.0.0.1:5601/',
},
directories => [
{
path => '/',
provider => 'location',
auth_name => 'Kibana Authentication',
auth_type => 'Basic',
auth_basic_provider => 'ldap',
custom_fragment => "AuthLDAPURL 'ldaps://ldap.example.com/dc=example,dc=com?CN?sub?(objectClass=user)'
AuthLDAPBindDN 'cn=serviceuser,ou=Users,dc=example,dc=com'
AuthLDAPBindPassword supersecretpassword",
require => 'ldap-group cn=application_users,ou=application_groups,ou=groups,dc=example,dc=com',
},
],
}

Kohana Routes and Pagination

I'm using Kohana 3.3 and have the following directory structure setup (+ sign means a folder, • means a file):
+ modules
+ app-admin
+ classes
+ admin
• Companies.php
• Users.php
• Locations.php
+ i18n
+ views
+ app-front
+ classes
+ i18n
+ views
For "app-admin" module I have following routes defined:
Route::set('admin default', 'admin')
->defaults(array(
'directory' => 'admin',
'controller' => 'authentication',
'action' => 'login'
));
Route::set('admin', 'admin/<controller>(/<action>(/<id>))')
->defaults(array(
'directory' => 'admin'
));
These routes enable me to access "admin" controllers as such:
http://localhost/admin/companies
http://localhost/admin/companies/edit/2
http://localhost/admin/companies/add
This works with no issue. I installed a pagination module (https://github.com/webking/kohana-pagination) which has following config:
'admin' => array(
'current_page' => array('source' => 'query_string', 'key' => 'page'), // source: "query_string" or "route"
'total_items' => 0,
'items_per_page' => 2,
'view' => 'admin/_partials/pagination',
'auto_hide' => FALSE,
'first_page_in_url' => FALSE,
)
When I do this, I'm getting following error:
Kohana_Exception [ 0 ]: Required route parameter not passed: controller
SYSPATH\classes\Kohana\Route.php [ 599 ]
What am I doing wrong?
Thanks,
Z
I ended up setting up a route specifically for each controller in the "admin" module and provided a default "controller" value as such:
Route::set('admin users', 'admin/users(/<action>(/<id>))')
->defaults(array(
'directory' => 'admin',
'controller' => 'users', // Provided a default value for <controller>
'action' => 'index'
));
And it did the job, the pagination is working ok now. I thought a "catch-all" route for "admin" would do this for me.

Resources