You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2020/09/09 16:16:41 UTC

[incubator-ponymail-foal] branch master updated (dde29ce -> 6630c72)

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git.


    from dde29ce  7 or 8 only.
     new 2c455e9  wrong variable used here
     new 6630c72  If we hit a 404 on a source, fake the document, but don't assign a source

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 server/plugins/background.py |  4 ++--
 server/plugins/database.py   |  2 +-
 tools/migrate.py             | 12 ++++++++++--
 3 files changed, 13 insertions(+), 5 deletions(-)


[incubator-ponymail-foal] 02/02: If we hit a 404 on a source, fake the document, but don't assign a source

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git

commit 6630c727620c514c6d4ca1840040c056d457e96a
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Wed Sep 9 18:16:29 2020 +0200

    If we hit a 404 on a source, fake the document, but don't assign a source
---
 tools/migrate.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/tools/migrate.py b/tools/migrate.py
index 5d5e689..a1d14b8 100644
--- a/tools/migrate.py
+++ b/tools/migrate.py
@@ -50,7 +50,6 @@ async def main():
     if dkim_txt.lower() == 'n':
         do_dkim = False
 
-
     # Define index names for new ES
     dbname_mbox = new_dbprefix + "-mbox"
     dbname_source = new_dbprefix + "-source"
@@ -74,7 +73,16 @@ async def main():
         index=old_dbname,
     ):
         list_id = doc['_source']['list_raw'].strip("<>")
-        source = await es.get(index=old_dbname, doc_type="mbox_source", id=doc['_id'])
+        try:
+            source = await es.get(index=old_dbname, doc_type="mbox_source", id=doc['_id'])
+        # If we hit a 404 on a source, we have to fake an empty document, as we don't know the source.
+        except:
+            print("Source for %s was not found, faking it..." % doc['_id'])
+            source = {
+                '_source': {
+                    'source': ""
+                }
+            }
         source_text: str = source['_source']['source']
         if ':' not in source_text:  # Base64
             source_text = base64.b64decode(source_text)


[incubator-ponymail-foal] 01/02: wrong variable used here

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git

commit 2c455e98db1828e0ff9ea3a3571610655784d5d4
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Wed Sep 9 18:13:51 2020 +0200

    wrong variable used here
---
 server/plugins/background.py | 4 ++--
 server/plugins/database.py   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/server/plugins/background.py b/server/plugins/background.py
index fdd6d97..1c1b91f 100644
--- a/server/plugins/background.py
+++ b/server/plugins/background.py
@@ -44,7 +44,7 @@ async def get_lists(database: plugins.configuration.DBConfig) -> dict:
             {
                 "host": database.hostname,
                 "port": database.port,
-                "url_prefix": database.db_prefix,
+                "url_prefix": database.url_prefix,
                 "use_ssl": database.secure,
             },
         ]
@@ -99,7 +99,7 @@ async def get_public_activity(database: plugins.configuration.DBConfig) -> dict:
             {
                 "host": database.hostname,
                 "port": database.port,
-                "url_prefix": database.db_prefix,
+                "url_prefix": database.url_prefix,
                 "use_ssl": database.secure,
             },
         ]
diff --git a/server/plugins/database.py b/server/plugins/database.py
index 910073a..6719771 100644
--- a/server/plugins/database.py
+++ b/server/plugins/database.py
@@ -54,7 +54,7 @@ class Database:
                 {
                     "host": config.hostname,
                     "port": config.port,
-                    "url_prefix": config.db_prefix,
+                    "url_prefix": config.url_prefix,
                     "use_ssl": config.secure,
                 },
             ]