annotate conf/Init.luan @ 42:af4632c42979

fix init conf to fix subscription emails
author Vadim Filimonov <fffilimonov@yandex.ru>
date Mon, 07 Jun 2021 09:52:13 +0300
parents 862b1ef23e75
children 4d90d48a19ec
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1 java()
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
2 local Luan = require "luan:Luan.luan"
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
3 local error = Luan.error
2
abe0694e9849 replace local_dir with home_dir
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
4 local Io = require "luan:Io.luan"
abe0694e9849 replace local_dir with home_dir
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
5 local uri = Io.uri or error()
0
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
6 local MailHome = require "java:fschmidt.util.mail.MailHome"
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7 local System = require "java:java.lang.System"
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8 local Logging = require "luan:logging/Logging.luan"
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9 local logger = Logging.logger "Init_default"
42
af4632c42979 fix init conf to fix subscription emails
Vadim Filimonov <fffilimonov@yandex.ru>
parents: 18
diff changeset
10 local pairs = Luan.pairs or error()
0
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
11
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
12 local Init = {}
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
13
42
af4632c42979 fix init conf to fix subscription emails
Vadim Filimonov <fffilimonov@yandex.ru>
parents: 18
diff changeset
14 System.setProperty("mail.smtp.host", "mail.smtp2go.com")
0
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
15 System.setProperty("mail.mime.base64.ignoreerrors", "true")
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
16 System.setProperty("mail.mime.address.strict", "false")
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
17 System.setProperty("mail.mime.decodetext.strict", "false")
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
18
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
19 Init.dbUrl = "jdbc:postgresql://localhost:5432/nabble"
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
20 Init.dbUser = "administrator"
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
21 Init.dbPassword = ""
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
22
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
23 Init.poolSize = 130
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
24
2
abe0694e9849 replace local_dir with home_dir
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
25 Init.home_dir = uri( uri("classpath:nabble").to_string() ).parent().parent().to_string().."/"
0
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
26
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
27 -- for now
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
28 local smtp = MailHome.getSmtpServer("mail.smtp2go.com","dev@singlesushi.com","FB4dating")
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
29 smtp.setPort(2525)
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
30 MailHome.setDefaultSmtpServer(smtp)
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
31
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
32 Init.homeContextUrl = "http://me.nabble.com:8081"
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
33
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
34 Init.deleteInactiveSites = false
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
35 Init.nabbleHost = "me.nabble.com:8080"
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
36
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
37
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
38 Init.defaultHost = "me.nabble.com:8080"
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
39 Init.domain = Init.defaultHost
42
af4632c42979 fix init conf to fix subscription emails
Vadim Filimonov <fffilimonov@yandex.ru>
parents: 18
diff changeset
40 Init.mailDomain = Init.defaultHost
0
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
41 Init.nabbleHost = Init.defaultHost
42
af4632c42979 fix init conf to fix subscription emails
Vadim Filimonov <fffilimonov@yandex.ru>
parents: 18
diff changeset
42 Init.mailDomain = "me.nabble.com"
0
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
43
42
af4632c42979 fix init conf to fix subscription emails
Vadim Filimonov <fffilimonov@yandex.ru>
parents: 18
diff changeset
44 local popMailServer = "pop.fastmail.com"
af4632c42979 fix init conf to fix subscription emails
Vadim Filimonov <fffilimonov@yandex.ru>
parents: 18
diff changeset
45
0
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
46 local function getPop3Server(addr, pwd)
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
47 local server = MailHome.getPop3Server(popMailServer, addr, pwd)
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
48 server.useSsl()
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
49 return server
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
50 end
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
51
42
af4632c42979 fix init conf to fix subscription emails
Vadim Filimonov <fffilimonov@yandex.ru>
parents: 18
diff changeset
52 local pop3 = {
af4632c42979 fix init conf to fix subscription emails
Vadim Filimonov <fffilimonov@yandex.ru>
parents: 18
diff changeset
53 lists = 'mailingListArchivePop3Server'
af4632c42979 fix init conf to fix subscription emails
Vadim Filimonov <fffilimonov@yandex.ru>
parents: 18
diff changeset
54 fwd = 'fwdPop3Server'
af4632c42979 fix init conf to fix subscription emails
Vadim Filimonov <fffilimonov@yandex.ru>
parents: 18
diff changeset
55 ml = 'subscriptionsPop3Server'
af4632c42979 fix init conf to fix subscription emails
Vadim Filimonov <fffilimonov@yandex.ru>
parents: 18
diff changeset
56 sb = 'subscriptionBouncesPop3Server'
af4632c42979 fix init conf to fix subscription emails
Vadim Filimonov <fffilimonov@yandex.ru>
parents: 18
diff changeset
57 }
0
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
58
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
59 local pop3Servers = {
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
60 lists = 'mailingListArchivePop3Server'
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
61 fwd = 'fwdPop3Server'
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
62 ml = 'subscriptionsPop3Server'
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
63 sb = 'subscriptionBouncesPop3Server'
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
64 }
42
af4632c42979 fix init conf to fix subscription emails
Vadim Filimonov <fffilimonov@yandex.ru>
parents: 18
diff changeset
65
0
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
66 for name, password in pairs(pop3) do
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
67 Init[pop3Servers[name]] = getPop3Server( name.."@"..Init.mailDomain, password )
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
68 end
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
69
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
70 --local HashSet = require "java:java.util.HashSet"
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
71 --Init.sysadmins = HashSet.new {} -- list of emails
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
72
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
73 --Init.monitor_emails = {} -- list of emails
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
74
6
c4ed473452d4 better https support
Franklin Schmidt <fschmidt@gmail.com>
parents: 2
diff changeset
75 --Init.ssl_dir = nil
c4ed473452d4 better https support
Franklin Schmidt <fschmidt@gmail.com>
parents: 2
diff changeset
76
0
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
77
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
78 -- for serve_nabble.luan
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
79
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
80 function Init.fix_serve(Serve)
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
81 if Serve.is_www then
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
82 Serve.is_forums = false
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
83 else
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
84 Serve.www_port = 8081
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
85 Serve.is_www = true
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
86 end
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
87 end
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
88
18
862b1ef23e75 add setup.sh
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
89 local Server = require "java:global.Server"
862b1ef23e75 add setup.sh
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
90 Server.add("local","jdbc:postgresql://localhost:5432/nabble","administrator","","me.nabble.com");
862b1ef23e75 add setup.sh
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
91
0
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
92 function Init.add_filters(context)
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
93 end
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
94
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
95
7ecd1a4ef557 add content
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
96 return Init