Squashed commit of the following:

commit f31e7ae2c1
Author: joenepraat <joenepraat@posteo.org>
Date:   Thu Mar 30 13:17:01 2023 +0000

    Translated using Weblate (Dutch)

    Currently translated at 94.5% (297 of 314 strings)

    Translation: Gancio/Web
    Translate-URL: https://hosted.weblate.org/projects/gancio/web/nl/

commit 96486b5945
Author: lesion <lesion@autistici.org>
Date:   Thu Mar 30 11:18:39 2023 +0200

    minor

commit 9524fd52f3
Author: lesion <lesion@autistici.org>
Date:   Thu Mar 30 00:08:27 2023 +0200

    update changelog, releasing v1.6.8

commit df4ec69128
Author: lesion <lesion@autistici.org>
Date:   Wed Mar 29 12:41:52 2023 +0200

    force vuetify to not use google fonts

commit e35595df82
Author: lesion <lesion@autistici.org>
Date:   Tue Mar 28 21:54:06 2023 +0200

    layout

commit ee8a9843b3
Author: lesion <lesion@autistici.org>
Date:   Tue Mar 28 21:48:26 2023 +0200

    minor

commit 2608761a44
Author: lesion <lesion@autistici.org>
Date:   Tue Mar 28 19:04:49 2023 +0200

    update deps

commit d7c8de7580
Author: lesion <lesion@autistici.org>
Date:   Tue Mar 28 19:04:41 2023 +0200

    minor

commit 6b55ba1708
Author: lesion <lesion@autistici.org>
Date:   Tue Mar 28 19:04:16 2023 +0200

    use new luxon in rss template, fixing locale and timezone #254

commit fc52107bd9
Author: lesion <lesion@autistici.org>
Date:   Tue Mar 28 19:02:08 2023 +0200

    use luxon instead of dayjs server side too

commit f5604a03bc
Author: lesion <lesion@autistici.org>
Date:   Tue Mar 28 18:55:57 2023 +0200

    unit test for recurrent events

commit 3e81d1dfb3
Merge: f960400 e750fc8
Author: lesion <lesion@autistici.org>
Date:   Tue Mar 28 18:51:34 2023 +0200

    Merge remote-tracking branch 'weblate/master'

commit f960400085
Author: lesion <lesion@autistici.org>
Date:   Mon Mar 27 17:19:27 2023 +0200

    improve index/tag/place layout

commit 0682feaaf8
Author: lesion <lesion@autistici.org>
Date:   Mon Mar 27 17:18:57 2023 +0200

    minor with theme admin colors

commit e750fc8e81
Author: josé m <correoxm@disroot.org>
Date:   Sun Mar 26 07:48:06 2023 +0000

    Translated using Weblate (Galician)

    Currently translated at 100.0% (314 of 314 strings)

    Translation: Gancio/Web
    Translate-URL: https://hosted.weblate.org/projects/gancio/web/gl/

commit 4c74fd3227
Author: gallegonovato <fran-carro@hotmail.es>
Date:   Sat Mar 25 11:23:48 2023 +0000

    Translated using Weblate (Spanish)

    Currently translated at 100.0% (314 of 314 strings)

    Translation: Gancio/Web
    Translate-URL: https://hosted.weblate.org/projects/gancio/web/es/

commit 428a94290f
Author: joenepraat <joenepraat@posteo.org>
Date:   Thu Mar 23 15:15:58 2023 +0000

    Translated using Weblate (Dutch)

    Currently translated at 95.5% (299 of 313 strings)

    Translation: Gancio/Web
    Translate-URL: https://hosted.weblate.org/projects/gancio/web/nl/

commit 373f78cd4e
Author: joenepraat <joenepraat@posteo.org>
Date:   Thu Mar 23 17:47:21 2023 +0000

    Translated using Weblate (Dutch)

    Currently translated at 7.6% (1 of 13 strings)

    Translation: Gancio/Email
    Translate-URL: https://hosted.weblate.org/projects/gancio/email/nl/

commit 2d11d88e8f
Merge: ea3066c e2fd5f8
Author: lesion <lesion@autistici.org>
Date:   Sat Mar 25 09:34:44 2023 +0100

    Merge remote-tracking branch 'weblate/master'

commit e2fd5f8b93
Author: joenepraat <joenepraat@posteo.org>
Date:   Thu Mar 23 15:15:58 2023 +0000

    Translated using Weblate (Dutch)

    Currently translated at 95.5% (299 of 313 strings)

    Translation: Gancio/Web
    Translate-URL: https://hosted.weblate.org/projects/gancio/web/nl/

commit 8280eb7c7a
Author: joenepraat <joenepraat@posteo.org>
Date:   Thu Mar 23 17:47:21 2023 +0000

    Translated using Weblate (Dutch)

    Currently translated at 7.6% (1 of 13 strings)

    Translation: Gancio/Email
    Translate-URL: https://hosted.weblate.org/projects/gancio/email/nl/

commit ea3066c34e
Author: lesion <lesion@autistici.org>
Date:   Fri Mar 24 16:03:08 2023 +0100

    people could choose custom colors

commit 8149ea23da
Author: lesion <lesion@autistici.org>
Date:   Wed Mar 22 15:39:02 2023 +0100

    moving vuetify configuration to "middleware"

commit 7e6130155a
Author: lesion <lesion@autistici.org>
Date:   Fri Mar 10 21:58:02 2023 +0100

    start with custom color

commit e2b07a06bd
Author: lesion <lesion@autistici.org>
Date:   Thu Mar 23 13:11:15 2023 +0100

    release WPGancio 1.7

commit b91774ac39
Author: lesion <lesion@autistici.org>
Date:   Thu Mar 23 13:09:10 2023 +0100

    fix tags merge in wp plugin and end_datetime

commit c8493d0810
Author: lesion <lesion@autistici.org>
Date:   Wed Mar 22 18:45:48 2023 +0100

    use new $time plugin instead of filters, fix #252

commit 780938ef91
Author: lesion <lesion@autistici.org>
Date:   Wed Mar 22 16:51:02 2023 +0100

    v1.6.7

commit 442f88f322
Author: lesion <lesion@autistici.org>
Date:   Wed Mar 22 16:49:37 2023 +0100

    minor

commit 9f90df2bfc
Author: lesion <lesion@autistici.org>
Date:   Wed Mar 22 16:24:08 2023 +0100

    v.1.6.6

commit 71fdeb6ff8
Author: lesion <lesion@autistici.org>
Date:   Wed Mar 22 16:17:02 2023 +0100

    some old event was flagged has multidate but without an end_datetime?

    fix #245

commit e6977368c5
Author: lesion <lesion@autistici.org>
Date:   Wed Mar 22 13:41:50 2023 +0100

    revert Intl, node is not ready, fix #250

commit eb2bf32162
Author: lesion <lesion@autistici.org>
Date:   Tue Mar 21 16:47:47 2023 +0100

    release v1.6.5

commit 0ebb467630
Author: lesion <lesion@autistici.org>
Date:   Tue Mar 21 01:15:35 2023 +0100

    minor

commit 934466b2ec
Author: lesion <lesion@autistici.org>
Date:   Mon Mar 20 21:09:58 2023 +0100

    add modules in package

commit ec62ad9ba8
Author: lesion <lesion@autistici.org>
Date:   Mon Mar 20 21:09:43 2023 +0100

    v-lazy in collection page too

commit d9f093fdbb
Author: lesion <lesion@autistici.org>
Date:   Mon Mar 20 12:55:17 2023 +0100

    releasing v1.6.5

commit 2ffd2aff82
Author: lesion <lesion@autistici.org>
Date:   Mon Mar 20 12:53:41 2023 +0100

    enable task manager in dev mode

commit 02f138e0f2
Author: lesion <lesion@autistici.org>
Date:   Mon Mar 20 12:40:39 2023 +0100

    update CHANGELOG

commit b8e096ee39
Author: lesion <lesion@autistici.org>
Date:   Mon Mar 20 12:40:19 2023 +0100

    minor with 2w recurrent event frequency

commit 8f221fb69c
Author: lesion <lesion@autistici.org>
Date:   Sun Mar 19 23:33:55 2023 +0100

    minor

commit 079bcd4af2
Merge: 99d78e2 ae990fc
Author: lesion <lesion@autistici.org>
Date:   Sun Mar 19 23:28:44 2023 +0100

    Merge remote-tracking branch 'sedum/feat/ssr-proxy'

commit 99d78e2492
Author: lesion <lesion@autistici.org>
Date:   Sun Mar 19 23:26:57 2023 +0100

    Squashed commit of the following:

    commit 5c0d380740c24e0467cef916fd0560cb26409f9f
    Author: lesion <lesion@autistici.org>
    Date:   Sun Mar 19 23:22:25 2023 +0100

        update yarn.lock

    commit 909ee71ecb8f27e4fba72430aecc92bf527e6cd4
    Author: lesion <lesion@autistici.org>
    Date:   Sun Mar 19 23:22:09 2023 +0100

        Squashed commit of the following:

        commit fc8a9f4506
        Author: lesion <lesion@autistici.org>
        Date:   Tue Mar 14 16:42:24 2023 +0100

            address some issues with recurrent events, fix #247

        commit f7357666ca
        Author: lesion <lesion@autistici.org>
        Date:   Tue Mar 14 16:16:52 2023 +0100

            fix event import from URL

        commit e1bca6f46a
        Author: lesion <lesion@autistici.org>
        Date:   Tue Mar 14 16:15:42 2023 +0100

             add Duch (nl) locale (thanks @jeoenepraat)

        commit 5f8afdbc12
        Merge: 57a052a 92ca5ab
        Author: lesion <lesion@autistici.org>
        Date:   Tue Mar 14 11:39:50 2023 +0100

            Merge remote-tracking branch 'weblate/master'

        commit 57a052a7fa
        Merge: 63d1d2e 55137d2
        Author: lesion <lesion@autistici.org>
        Date:   Tue Mar 14 11:39:33 2023 +0100

            Merge commit '55137d2ac23549e633f36ad10139fd4168c2645f'

        commit 92ca5abf5e
        Author: joenepraat <joenepraat@posteo.org>
        Date:   Fri Mar 10 23:16:32 2023 +0000

            Translated using Weblate (Dutch)

            Currently translated at 68.3% (214 of 313 strings)

            Translation: Gancio/Web
            Translate-URL: https://hosted.weblate.org/projects/gancio/web/nl/

        commit 63d1d2ee53
        Author: lesion <lesion@autistici.org>
        Date:   Thu Mar 9 21:41:06 2023 +0100

            minor

        commit d2759a55a5
        Author: lesion <lesion@autistici.org>
        Date:   Thu Mar 9 21:38:39 2023 +0100

            wrong user / admin merge dark theme settings - fix #244

        commit b401d829db
        Author: lesion <lesion@autistici.org>
        Date:   Thu Mar 9 21:24:45 2023 +0100

            remove a small warning

        commit ccffe5f7b0
        Author: lesion <lesion@autistici.org>
        Date:   Fri Feb 24 11:40:36 2023 +0100

            push tags on release

        commit 55137d2ac2
        Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
        Date:   Thu Feb 23 23:56:16 2023 +0000

            Bump sequelize from 6.28.0 to 6.29.0

            Bumps [sequelize](https://github.com/sequelize/sequelize) from 6.28.0 to 6.29.0.
            - [Release notes](https://github.com/sequelize/sequelize/releases)
            - [Commits](https://github.com/sequelize/sequelize/compare/v6.28.0...v6.29.0)

            ---
            updated-dependencies:
            - dependency-name: sequelize
              dependency-type: direct:production
            ...

            Signed-off-by: dependabot[bot] <support@github.com>

        commit b654f29d8b
        Author: lesion <lesion@autistici.org>
        Date:   Wed Feb 22 13:21:17 2023 +0100

            update changelog

        commit 0cd1ee9d89
        Author: lesion <lesion@autistici.org>
        Date:   Wed Feb 22 13:17:29 2023 +0100

            increase rate limit max requests per minutes

        commit b6dafc082e
        Author: lesion <lesion@autistici.org>
        Date:   Wed Feb 22 08:45:39 2023 +0100

            minor

        commit 0fa7769844
        Author: lesion <lesion@autistici.org>
        Date:   Wed Feb 22 08:45:18 2023 +0100

            location saving is not working when geocoding is disabled, fix #238

        commit 07f9e2d9ee
        Author: lesion <lesion@autistici.org>
        Date:   Wed Feb 22 08:33:40 2023 +0100

            really fix #232

        commit bae930799e
        Author: lesion <lesion@autistici.org>
        Date:   Wed Feb 22 08:33:09 2023 +0100

            downgrade mariadb (sequelize is not ready)

        commit d733d7fef1
        Author: lesion <lesion@autistici.org>
        Date:   Wed Feb 22 00:16:28 2023 +0100

            aargh

        commit 98b22aad70
        Author: lesion <lesion@autistici.org>
        Date:   Tue Feb 21 00:56:06 2023 +0100

            minor

        commit fc098b603d
        Author: lesion <lesion@autistici.org>
        Date:   Tue Feb 21 00:55:44 2023 +0100

            missing i18n in setup, fix #239

        commit 3eaf72af19
        Merge: bba196b d6c6034
        Author: lesion <lesion@autistici.org>
        Date:   Mon Feb 20 21:17:37 2023 +0100

            Merge remote-tracking branch 'weblate/master'

        commit bba196b068
        Author: lesion <lesion@autistici.org>
        Date:   Sat Feb 18 00:05:52 2023 +0100

            update changelog, v1.6.3

        commit bb9f7cca47
        Author: lesion <lesion@autistici.org>
        Date:   Sat Feb 18 00:04:28 2023 +0100

            minor

        commit 80d2dbd06b
        Author: lesion <lesion@autistici.org>
        Date:   Fri Feb 17 23:40:28 2023 +0100

            minor

        commit d6c6034630
        Author: fadelkon <fadelkon@posteo.net>
        Date:   Thu Feb 16 22:09:23 2023 +0000

            Translated using Weblate (Catalan)

            Currently translated at 100.0% (313 of 313 strings)

            Translation: Gancio/Web
            Translate-URL: https://hosted.weblate.org/projects/gancio/web/ca/

        commit d125cf1506
        Author: lesion <lesion@autistici.org>
        Date:   Fri Feb 17 21:56:31 2023 +0100

            set a default user_locale path

        commit 4367960a62
        Merge: c8cc5c6 87dd179
        Author: lesion <lesion@autistici.org>
        Date:   Tue Feb 7 17:46:58 2023 +0100

            Merge branch 'master' into gh

        commit c8cc5c6c97
        Merge: 88e0c90 550e221
        Author: lesion <lesion@autistici.org>
        Date:   Mon Jan 9 17:15:21 2023 +0100

            Merge branch 'master' into gh

        commit 88e0c90a66
        Merge: 421aa12 f212ac1
        Author: lesion <lesion@autistici.org>
        Date:   Thu Dec 15 09:54:41 2022 +0100

            Merge branch 'master' into gh

        commit 421aa12781
        Merge: 5f6cc46 b3488e7
        Author: lesion <lesion@autistici.org>
        Date:   Wed Sep 28 12:26:08 2022 +0200

            Merge branch 'master' into gh

        commit 5f6cc46cdc
        Merge: b66feb9 171d968
        Author: lesion <lesion@autistici.org>
        Date:   Mon Aug 8 00:08:12 2022 +0200

            Merge branch 'master' into gh

        commit b66feb92e2
        Merge: 80c55d5 05d068f
        Author: lesion <lesion@autistici.org>
        Date:   Tue Jun 21 23:48:40 2022 +0200

            Merge branch 'master' into gh

        commit 80c55d5601
        Merge: 814090e a154fdf
        Author: lesion <lesion@autistici.org>
        Date:   Mon Jun 6 17:27:00 2022 +0200

            Merge branch 'master' into gh

        commit 814090e9b6
        Merge: 616c542 2e3aba9
        Author: lesion <lesion@autistici.org>
        Date:   Mon Jun 6 17:19:31 2022 +0200

            Merge branch 'master' into gh

        commit 616c54229a
        Merge: e4cb22e 82dcaf9
        Author: lesion <lesion@autistici.org>
        Date:   Mon Jun 6 16:57:05 2022 +0200

            Merge branch 'master' into gh

        commit e4cb22ee33
        Merge: 5dddfbd 8657937
        Author: lesion <lesion@autistici.org>
        Date:   Fri Mar 11 23:41:22 2022 +0100

            Merge branch 'master' into gh

        commit 5dddfbd29e
        Merge: 60e9d95 10c6b0d
        Author: lesion <lesion@autistici.org>
        Date:   Fri Mar 11 23:22:12 2022 +0100

            Merge branch 'master' into gh

        commit 60e9d95ba8
        Merge: 79445ca ad93f83
        Author: lesion <lesion@autistici.org>
        Date:   Tue Dec 7 01:35:18 2021 +0100

            Merge branch 'master' into gh

        commit 79445ca8a7
        Merge: 9472d8d cd313ef
        Author: les <lesion@autistici.org>
        Date:   Thu Jun 24 21:52:25 2021 +0200

            Merge branch 'master' into gh

        commit 9472d8d919
        Merge: f960149 9e9643e
        Author: les <lesion@autistici.org>
        Date:   Fri Mar 26 22:27:41 2021 +0100

            Merge branch 'dev' into gh

        commit f9601492dc
        Author: les <lesion@autistici.org>
        Date:   Fri Dec 6 11:30:41 2019 +0100

            update dependencies

        commit f8c7fa2b45
        Author: les <lesion@autistici.org>
        Date:   Fri Dec 6 11:41:13 2019 +0100

            minor

        commit 33ca266535
        Author: les <lesion@autistici.org>
        Date:   Fri Dec 6 11:38:15 2019 +0100

            prepare gh as a mirror

    commit 5c8875411631048210eb50030e83cb272a40d54a
    Author: lesion <lesion@autistici.org>
    Date:   Sun Mar 19 23:18:40 2023 +0100

        update deps

    commit 7eac4fce324a6e75cdda296d672317cf2497c005
    Author: lesion <lesion@autistici.org>
    Date:   Sun Mar 19 23:18:25 2023 +0100

        refactoring event detail page

    commit dc9ca88bc62708b869be3f3efe51d9155fe17830
    Author: lesion <lesion@autistici.org>
    Date:   Sun Mar 19 23:17:35 2023 +0100

        show hide boosts/bookmarks, fix #241

    commit d4a25b1dd0b9404e0de7ca5cf546f0d29bc8943e
    Author: lesion <lesion@autistici.org>
    Date:   Sun Mar 19 23:13:58 2023 +0100

        minor with unixFormat

    commit 239d6bcab19ef3cf53d1b2544a5c9a36ba8dd25b
    Author: lesion <lesion@autistici.org>
    Date:   Sun Mar 19 23:12:25 2023 +0100

        minor

    commit b149f980db8245c12a6940997be6d5657bddf829
    Author: lesion <lesion@autistici.org>
    Date:   Sun Mar 19 23:12:05 2023 +0100

        minor

    commit 6f2955c584ec9da2c10991fb09ab57735a31385d
    Author: lesion <lesion@autistici.org>
    Date:   Sun Mar 19 23:11:49 2023 +0100

        minor

    commit dd586c38c9ef2f0b408ef90eb27dffe53355305a
    Author: lesion <lesion@autistici.org>
    Date:   Sun Mar 19 23:11:31 2023 +0100

        minor on style

    commit 544823717b9801e63bef15394b25bfbcd842c10f
    Author: lesion <lesion@autistici.org>
    Date:   Sun Mar 19 23:11:15 2023 +0100

        fix multidate issue, go to event on save

    commit 9ef0c75d03ee2d69f89034b28d6991f85ffefb06
    Author: lesion <lesion@autistici.org>
    Date:   Sun Mar 19 23:09:47 2023 +0100

        use v-lazy, improve search, full tag/place events

    commit ac91072b79960815e0535e63ac45e0b5c6100764
    Author: lesion <lesion@autistici.org>
    Date:   Sun Mar 19 22:47:51 2023 +0100

        increase DDOS limiter to 250 req/min

    commit d0ca92efb4afe48d2fd236083d9e290ab8d49704
    Author: lesion <lesion@autistici.org>
    Date:   Sun Mar 19 22:47:14 2023 +0100

        update changelog

    commit 2d54f19225acc4118d60ef8c9d12f9495e6776ca
    Author: lesion <lesion@autistici.org>
    Date:   Sun Mar 19 22:46:51 2023 +0100

        use luxon instead of dayjs, new $time plugin

commit ae990fc370
Author: sedum <sedum@oziosi.org>
Date:   Thu Mar 16 17:29:48 2023 +0100

    add support for server side http proxy, close #240

commit fc8a9f4506
Author: lesion <lesion@autistici.org>
Date:   Tue Mar 14 16:42:24 2023 +0100

    address some issues with recurrent events, fix #247

commit f7357666ca
Author: lesion <lesion@autistici.org>
Date:   Tue Mar 14 16:16:52 2023 +0100

    fix event import from URL

commit e1bca6f46a
Author: lesion <lesion@autistici.org>
Date:   Tue Mar 14 16:15:42 2023 +0100

     add Duch (nl) locale (thanks @jeoenepraat)

commit 5f8afdbc12
Merge: 57a052a 92ca5ab
Author: lesion <lesion@autistici.org>
Date:   Tue Mar 14 11:39:50 2023 +0100

    Merge remote-tracking branch 'weblate/master'

commit 57a052a7fa
Merge: 63d1d2e 55137d2
Author: lesion <lesion@autistici.org>
Date:   Tue Mar 14 11:39:33 2023 +0100

    Merge commit '55137d2ac23549e633f36ad10139fd4168c2645f'

commit 92ca5abf5e
Author: joenepraat <joenepraat@posteo.org>
Date:   Fri Mar 10 23:16:32 2023 +0000

    Translated using Weblate (Dutch)

    Currently translated at 68.3% (214 of 313 strings)

    Translation: Gancio/Web
    Translate-URL: https://hosted.weblate.org/projects/gancio/web/nl/

commit 63d1d2ee53
Author: lesion <lesion@autistici.org>
Date:   Thu Mar 9 21:41:06 2023 +0100

    minor

commit d2759a55a5
Author: lesion <lesion@autistici.org>
Date:   Thu Mar 9 21:38:39 2023 +0100

    wrong user / admin merge dark theme settings - fix #244

commit b401d829db
Author: lesion <lesion@autistici.org>
Date:   Thu Mar 9 21:24:45 2023 +0100

    remove a small warning

commit 55137d2ac2
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Thu Feb 23 23:56:16 2023 +0000

    Bump sequelize from 6.28.0 to 6.29.0

    Bumps [sequelize](https://github.com/sequelize/sequelize) from 6.28.0 to 6.29.0.
    - [Release notes](https://github.com/sequelize/sequelize/releases)
    - [Commits](https://github.com/sequelize/sequelize/compare/v6.28.0...v6.29.0)

    ---
    updated-dependencies:
    - dependency-name: sequelize
      dependency-type: direct:production
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

commit 4367960a62
Merge: c8cc5c6 87dd179
Author: lesion <lesion@autistici.org>
Date:   Tue Feb 7 17:46:58 2023 +0100

    Merge branch 'master' into gh

commit c8cc5c6c97
Merge: 88e0c90 550e221
Author: lesion <lesion@autistici.org>
Date:   Mon Jan 9 17:15:21 2023 +0100

    Merge branch 'master' into gh

commit 88e0c90a66
Merge: 421aa12 f212ac1
Author: lesion <lesion@autistici.org>
Date:   Thu Dec 15 09:54:41 2022 +0100

    Merge branch 'master' into gh

commit 421aa12781
Merge: 5f6cc46 b3488e7
Author: lesion <lesion@autistici.org>
Date:   Wed Sep 28 12:26:08 2022 +0200

    Merge branch 'master' into gh

commit 5f6cc46cdc
Merge: b66feb9 171d968
Author: lesion <lesion@autistici.org>
Date:   Mon Aug 8 00:08:12 2022 +0200

    Merge branch 'master' into gh

commit b66feb92e2
Merge: 80c55d5 05d068f
Author: lesion <lesion@autistici.org>
Date:   Tue Jun 21 23:48:40 2022 +0200

    Merge branch 'master' into gh

commit 80c55d5601
Merge: 814090e a154fdf
Author: lesion <lesion@autistici.org>
Date:   Mon Jun 6 17:27:00 2022 +0200

    Merge branch 'master' into gh

commit 814090e9b6
Merge: 616c542 2e3aba9
Author: lesion <lesion@autistici.org>
Date:   Mon Jun 6 17:19:31 2022 +0200

    Merge branch 'master' into gh

commit 616c54229a
Merge: e4cb22e 82dcaf9
Author: lesion <lesion@autistici.org>
Date:   Mon Jun 6 16:57:05 2022 +0200

    Merge branch 'master' into gh

commit e4cb22ee33
Merge: 5dddfbd 8657937
Author: lesion <lesion@autistici.org>
Date:   Fri Mar 11 23:41:22 2022 +0100

    Merge branch 'master' into gh

commit 5dddfbd29e
Merge: 60e9d95 10c6b0d
Author: lesion <lesion@autistici.org>
Date:   Fri Mar 11 23:22:12 2022 +0100

    Merge branch 'master' into gh

commit 60e9d95ba8
Merge: 79445ca ad93f83
Author: lesion <lesion@autistici.org>
Date:   Tue Dec 7 01:35:18 2021 +0100

    Merge branch 'master' into gh

commit 79445ca8a7
Merge: 9472d8d cd313ef
Author: les <lesion@autistici.org>
Date:   Thu Jun 24 21:52:25 2021 +0200

    Merge branch 'master' into gh

commit 9472d8d919
Merge: f960149 9e9643e
Author: les <lesion@autistici.org>
Date:   Fri Mar 26 22:27:41 2021 +0100

    Merge branch 'dev' into gh

commit f9601492dc
Author: les <lesion@autistici.org>
Date:   Fri Dec 6 11:30:41 2019 +0100

    update dependencies

commit f8c7fa2b45
Author: les <lesion@autistici.org>
Date:   Fri Dec 6 11:41:13 2019 +0100

    minor

commit 33ca266535
Author: les <lesion@autistici.org>
Date:   Fri Dec 6 11:38:15 2019 +0100

    prepare gh as a mirror
This commit is contained in:
lesion
2023-04-03 16:39:26 +02:00
parent 4da715dd39
commit 08e4fe856c
72 changed files with 2912 additions and 2254 deletions

View File

@@ -1,7 +1,7 @@
const { Collection, Filter, Event, Tag, Place } = require('../models/models')
const log = require('../../log')
const dayjs = require('dayjs')
const { DateTime } = require('luxon')
const { col: Col } = require('../../helpers')
const { Op, Sequelize } = require('sequelize')
@@ -21,7 +21,6 @@ const collectionController = {
// return events from collection
async getEvents (req, res) {
const format = req.params.format || 'json'
const name = req.params.name
const collection = await Collection.findOne({ where: { name } })
@@ -33,7 +32,7 @@ const collectionController = {
if (!filters.length) {
return res.json([])
}
const start = dayjs().unix()
const start = DateTime.local().toUnixInteger()
const where = {
// do not include parent recurrent event
recurrent: null,

View File

@@ -1,11 +1,11 @@
const crypto = require('crypto')
const path = require('path')
const config = require('../../config')
const fs = require('fs')
const fs = require('fs/promises')
const { Op } = require('sequelize')
const linkifyHtml = require('linkify-html')
const Sequelize = require('sequelize')
const dayjs = require('dayjs')
const { DateTime } = require('luxon')
const helpers = require('../../helpers')
const Col = helpers.col
const notifier = require('../../notifier')
@@ -85,73 +85,6 @@ const eventController = {
return res.json(ret)
},
// async search(req, res) {
// const search = req.query.search.trim().toLocaleLowerCase()
// const show_recurrent = req.query.show_recurrent || false
// const end = req.query.end
// const replacements = []
// const where = {
// // do not include parent recurrent event
// recurrent: null,
// // confirmed event only
// is_visible: true,
// }
// if (!show_recurrent) {
// where.parentId = null
// }
// if (end) {
// where.start_datetime = { [Op.lte]: end }
// }
// if (search) {
// replacements.push(search)
// where[Op.or] =
// [
// { title: Sequelize.where(Sequelize.fn('LOWER', Sequelize.col('title')), 'LIKE', '%' + search + '%') },
// Sequelize.where(Sequelize.fn('LOWER', Sequelize.col('name')), 'LIKE', '%' + search + '%'),
// Sequelize.fn('EXISTS', Sequelize.literal(`SELECT 1 FROM event_tags WHERE ${Col('event_tags.eventId')}=${Col('event.id')} AND LOWER(${Col('tagTag')}) = ?`))
// ]
// }
// const events = await Event.findAll({
// where,
// attributes: {
// exclude: ['likes', 'boost', 'userId', 'is_visible', 'createdAt', 'updatedAt', 'description', 'resources']
// },
// order: [['start_datetime', 'DESC']],
// include: [
// {
// model: Tag,
// // order: [Sequelize.literal('(SELECT COUNT("tagTag") FROM event_tags WHERE tagTag = tag) DESC')],
// attributes: ['tag'],
// through: { attributes: [] }
// },
// { model: Place, required: true, attributes: ['id', 'name', 'address', 'latitude', 'longitude'] }
// ],
// replacements,
// limit: 30,
// }).catch(e => {
// log.error('[EVENT]', e)
// return res.json([])
// })
// const ret = events.map(e => {
// e = e.get()
// e.tags = e.tags ? e.tags.map(t => t && t.tag) : []
// return e
// })
// return res.json(ret)
// },
async _get(slug) {
// retrocompatibility, old events URL does not use slug, use id as fallback
const id = Number(slug) || -1
@@ -319,7 +252,7 @@ const eventController = {
where: {
parentId: null,
is_visible: false,
start_datetime: { [Op.gt]: dayjs().unix() }
start_datetime: { [Op.gt]: DateTime.local().toUnixInteger() }
},
order: [['start_datetime', 'ASC']],
include: [{ model: Tag, required: false }, Place]
@@ -496,8 +429,8 @@ const eventController = {
try {
const old_path = path.resolve(config.upload_path, event.media[0].url)
const old_thumb_path = path.resolve(config.upload_path, 'thumb', event.media[0].url)
fs.unlinkSync(old_path)
fs.unlinkSync(old_thumb_path)
await fs.unlink(old_path)
await fs.unlink(old_thumb_path)
} catch (e) {
log.info(e.toString())
}
@@ -575,8 +508,8 @@ const eventController = {
try {
const old_path = path.join(config.upload_path, event.media[0].url)
const old_thumb_path = path.join(config.upload_path, 'thumb', event.media[0].url)
fs.unlinkSync(old_thumb_path)
fs.unlinkSync(old_path)
await fs.unlink(old_thumb_path)
await fs.unlink(old_path)
} catch (e) {
log.info(e.toString())
}
@@ -601,7 +534,7 @@ const eventController = {
* @returns
*/
async _select({
start = dayjs().unix(),
start = DateTime.local().toUnixInteger(),
end,
query,
tags,
@@ -610,7 +543,8 @@ const eventController = {
show_multidate,
limit,
page,
older }) {
older,
reverse }) {
const where = {
// do not include _parent_ recurrent event
@@ -680,7 +614,7 @@ const eventController = {
attributes: {
exclude: ['likes', 'boost', 'userId', 'is_visible', 'createdAt', 'description', 'resources', 'recurrent', 'placeId', 'image_path']
},
order: [['start_datetime', older ? 'DESC' : 'ASC']],
order: [['start_datetime', reverse ? 'DESC' : 'ASC']],
include: [
{
model: Tag,
@@ -709,7 +643,7 @@ const eventController = {
*/
async select(req, res) {
const settings = res.locals.settings
const start = req.query.start || dayjs().unix()
const start = req.query.start || DateTime.local().toUnixInteger()
const end = req.query.end
const query = req.query.query
const tags = req.query.tags
@@ -730,10 +664,12 @@ const eventController = {
},
/**
* Ensure we have the next instance of a recurrent event
* Ensure we have the next occurrence of a recurrent event
*/
async _createRecurrentOccurrence(e, startAt) {
async _createRecurrentOccurrence(e, startAt = DateTime.local(), firstOccurrence = true) {
log.debug(`Create recurrent event [${e.id}] ${e.title}"`)
// prepare the new event occurrence copying the parent's properties
const event = {
parentId: e.id,
title: e.title,
@@ -744,55 +680,67 @@ const eventController = {
placeId: e.placeId
}
const recurrent = e.recurrent
const start_date = dayjs.unix(e.start_datetime)
let cursor = start_date > startAt ? start_date : startAt
const recurrentDetails = e.recurrent
const parentStartDatetime = DateTime.fromSeconds(e.start_datetime)
// cursor is when start to count
// sets it to
let cursor = parentStartDatetime > startAt ? parentStartDatetime : startAt
startAt = cursor
const duration = dayjs.unix(e.end_datetime).diff(start_date, 's')
const frequency = recurrent.frequency
const type = recurrent.type
cursor = cursor.hour(start_date.hour()).minute(start_date.minute()).second(0)
const duration = e.end_datetime ? e.end_datetime-e.start_datetime : 0
const frequency = recurrentDetails.frequency
const type = recurrentDetails.type
if (!frequency) {
log.warn(`Recurrent event ${e.id} - ${e.title} does not have a frequency specified`)
return
}
if (!frequency) { return }
cursor = cursor.set({ hour: parentStartDatetime.hour, minute: parentStartDatetime.minute, second: 0 })
// each week or 2
if (frequency[1] === 'w') {
cursor = cursor.day(start_date.day())
if (cursor.isBefore(startAt)) {
cursor = cursor.add(7, 'day')
}
if (frequency[0] === '2') {
cursor = cursor.add(7, 'day')
cursor = cursor.set({ weekday: parentStartDatetime.weekday }) //day(parentStartDatetime.day())
if (cursor < startAt) {
cursor = cursor.plus({ days: 7 * Number(frequency[0]) })
}
} else if (frequency === '1m') {
if (type === 'ordinal') {
cursor = cursor.date(start_date.date())
cursor = cursor.set({ day: parentStartDatetime.day })
if (cursor.isBefore(startAt)) {
cursor = cursor.add(1, 'month')
if (cursor< startAt) {
cursor = cursor.plus({ months: 1 })
}
} else { // weekday
// get weekday
// get recurrent freq details
cursor = helpers.getWeekdayN(cursor, type, start_date.day())
if (cursor.isBefore(startAt)) {
cursor = cursor.add(4, 'week')
cursor = helpers.getWeekdayN(cursor, type, start_date.day())
cursor = helpers.getWeekdayN(cursor, type, parentStartDatetime.weekday)
if (cursor< startAt) {
cursor = cursor.plus({ months: 1 })
cursor = helpers.getWeekdayN(cursor, type, parentStartDatetime.weekday)
}
}
}
log.debug(cursor)
event.start_datetime = cursor.unix()
event.end_datetime = event.start_datetime + duration
const newEvent = await Event.create(event)
return newEvent.addTags(e.tags)
event.start_datetime = cursor.toUnixInteger()
event.end_datetime = e.end_datetime ? event.start_datetime + duration : null
try {
const newEvent = await Event.create(event)
if (e.tags) {
return newEvent.addTags(e.tags)
} else {
return newEvent
}
} catch (e) {
console.error(event)
log.error('[RECURRENT EVENT]', e)
}
},
/**
* Create instances of recurrent events
*/
async _createRecurrent(start_datetime = dayjs().unix()) {
async _createRecurrent(start_datetime = DateTime.local().toUnixInteger()) {
// select recurrent events and its childs
const events = await Event.findAll({
where: { is_visible: true, recurrent: { [Op.ne]: null } },
@@ -805,9 +753,9 @@ const eventController = {
const creations = events.map(e => {
if (e.child.length) {
if (e.child.find(c => c.is_visible)) return
return eventController._createRecurrentOccurrence(e, dayjs.unix(e.child[0].start_datetime + 1))
return eventController._createRecurrentOccurrence(e, DateTime.fromSeconds(e.child[0].start_datetime + 1), false)
}
return eventController._createRecurrentOccurrence(e, dayjs())
return eventController._createRecurrentOccurrence(e, DateTime.local(), true)
})
return Promise.all(creations)

View File

@@ -2,7 +2,7 @@ const { Event, Place, Tag } = require('../models/models')
const { htmlToText } = require('html-to-text')
const { Op, literal } = require('sequelize')
const moment = require('dayjs')
const { DateTime } = require('luxon')
const ics = require('ics')
const exportController = {
@@ -13,8 +13,13 @@ const exportController = {
const places = req.query.places
const show_recurrent = !!req.query.show_recurrent
const opt = {
zone: res.locals.settings.instance_timezone,
locale: res.locals.settings.instance_locale
}
const where = {}
const yesterday = moment().subtract('1', 'day').unix()
const yesterday = DateTime.local(opt).minus({day: 1}).toUnixInteger()
if (tags && places) {
@@ -69,8 +74,18 @@ const exportController = {
feed (_req, res, events, title = res.locals.settings.title, link = `${res.locals.settings.baseurl}/feed/rss`) {
const settings = res.locals.settings
const opt = {
zone: settings.instance_timezone,
locale: settings.instance_locale
}
function unixFormat (timestamp, format='EEEE d MMMM HH:mm') {
return DateTime.fromSeconds(timestamp, opt).toFormat(format)
}
res.type('application/rss+xml; charset=UTF-8')
res.render('feed/rss.pug', { events, settings, moment, title, link })
res.render('feed/rss.pug', { events, settings, unixFormat, title, link })
},
/**
@@ -82,8 +97,8 @@ const exportController = {
const settings = res.locals.settings
const eventsMap = events.map(e => {
const tmpStart = moment.unix(e.start_datetime)
const start = tmpStart.utc(true).format('YYYY-M-D-H-m').split('-').map(Number)
const tmpStart = DateTime.fromSeconds(e.start_datetime)
const start = [ tmpStart.year, tmpStart.month, tmpStart.day, tmpStart.hour, tmpStart.minute ]
const ret = {
uid: `${e.id}@${settings.hostname}`,
@@ -99,8 +114,8 @@ const exportController = {
}
if (e.end_datetime) {
const tmpEnd = moment.unix(e.end_datetime)
const end = tmpEnd.utc(true).format('YYYY-M-D-H-m').split('-').map(Number)
const tmpEnd = DateTime.fromSeconds(e.end_datetime)
const end = [ tmpEnd.year, tmpEnd.month, tmpEnd.day, tmpEnd.hour, tmpEnd.minute ]
ret.end = end
}

View File

@@ -56,11 +56,11 @@ const geocodingController = {
},
async nominatimRateLimit(req, res, next) {
geocodingController.providerRateLimit(req, res, next, nominatim.cache)
process.env.NODE_ENV === 'test' ? next() : geocodingController.providerRateLimit(req, res, next, nominatim.cache)
},
async photonRateLimit(req, res, next) {
geocodingController.providerRateLimit(req, res, next, photon.cache)
process.env.NODE_ENV === 'test' ? next() : geocodingController.providerRateLimit(req, res, next, photon.cache)
},
async checkInCache (req, res, details, providerCache) {

View File

@@ -18,7 +18,8 @@ const localeController = {
// check if we have a user custom messages
let customLocaleMessages = {}
const customLocalePath = path.resolve(config.user_locale, `${locale}.json`)
const customLocalePath = config.user_locale && path.resolve(config.user_locale, `${locale}.json`)
if (config.user_locale && fs.existsSync(customLocalePath)) {
try {
customLocaleMessages = require(customLocalePath)

View File

@@ -18,7 +18,7 @@ module.exports = {
const format = req.params.format || 'json'
log.debug(`Events for place: ${placeName}`)
const events = await eventController._select({ places: String(place.id), show_recurrent: true })
const events = await eventController._select({ places: String(place.id), show_recurrent: true, reverse: true, start_datetime: 0 })
switch (format) {
case 'rss':

View File

@@ -88,7 +88,7 @@ const pluginController = {
try {
const plugin = require(pluginFile)
const name = plugin.configuration.name
console.log(`Found plugin '${name}'`)
log.info(`Found plugin '${name}'`)
pluginController.plugins.push(plugin)
if (settingsController.settings['plugin_' + name]) {
const pluginSetting = settingsController.settings['plugin_' + name]

View File

@@ -6,7 +6,6 @@ const sharp = require('sharp')
const config = require('../../config')
const generateKeyPair = promisify(crypto.generateKeyPair)
const log = require('../../log')
// const locales = require('../../../locales/index')
const escape = require('lodash/escape')
const DB = require('../models/models')
@@ -43,7 +42,8 @@ const defaultSettings = {
enable_trusted_instances: true,
trusted_instances: [],
'theme.is_dark': true,
'theme.primary': '#FF4500',
dark_colors: { primary: '#FF6E40', error: '#FF5252', info: '#2196F3', success: '#4CAF50', warning: '#FB8C00' },
light_colors: { primary: '#FF4500', error: '#FF5252', info: '#2196F3', success: '#4CAF50', warning: '#FB8C00' },
trusted_instances_label: '',
hide_thumbs: false,
hide_calendar: false,
@@ -104,19 +104,6 @@ const settingsController = {
await settingsController.set('privateKey', privateKey, true)
}
// initialize user_locale
// if (config.user_locale && fs.existsSync(path.resolve(config.user_locale))) {
// const user_locales_files = fs.readdirSync(path.resolve(config.user_locale))
// user_locales_files.forEach( f => {
// const locale = path.basename(f ,'.json')
// if (locales[locale]) {
// log.info(`Adding custom locale ${locale}`)
// settingsController.user_locale[locale] = require(path.resolve(config.user_locale, f)).default
// } else {
// log.warning(`Unknown custom user locale: ${locale} [valid locales are ${locales}]`)
// }
// })
// }
const pluginController = require('./plugins')
pluginController._load()
},

View File

@@ -33,7 +33,7 @@ module.exports = {
const eventController = require('./event')
const format = req.params.format || 'json'
const tags = req.params.tag
const events = await eventController._select({ tags: tags.toLocaleLowerCase(), show_recurrent: true })
const events = await eventController._select({ tags: tags.toLocaleLowerCase(), show_recurrent: true, start_datetime: 0, reverse: true })
switch (format) {
case 'rss':
return exportController.feed(req, res, events,

View File

@@ -7,11 +7,11 @@ const instanceApiRateLimiter = {
DDOSProtectionApiRateLimiter: (process.env.NODE_ENV === 'test' ? next : rateLimit({
windowMs: 60 * 1000, // 1 minutes
max: 150, // Limit each IP to 150 requests per `window`
max: 250, // Limit each IP to 150 requests per `window`
standardHeaders: true, // Return rate limit info in the `RateLimit-*` headers
legacyHeaders: false, // Disable the `X-RateLimit-*` headers
handler: (request, response, next, options) => {
log.warn(`DDOS protection api rate limiter: > 150req/minute/ip ${request.ip}`)
log.warn(`DDOS protection api rate limiter: > 250req/minute/ip ${request.ip}`)
return response.status(options.statusCode).send(options.message)
}
})),

View File

@@ -1,6 +1,6 @@
const Email = require('email-templates')
const path = require('path')
const moment = require('dayjs')
const { DateTime } = require('luxon')
const settingsController = require('./controller/settings')
const log = require('../log')
const { Task, TaskManager } = require('../taskManager')
@@ -52,6 +52,11 @@ const mail = {
transport: settings.smtp || {}
})
const opt = {
zone: settings.instance_timezone,
locale
}
const msg = {
template,
message: {
@@ -61,7 +66,7 @@ const mail = {
...locals,
locale,
config: { title: settings.title, baseurl: settings.baseurl, description: settings.description, admin_email: settings.admin_email },
datetime: datetime => moment.unix(datetime).tz().locale(locale).format('ddd, D MMMM HH:mm')
datetime: timestamp => DateTime.fromSeconds(timestamp, opt).toFormat('EEEE, d MMMM HH:mm')
}
}
return email.send(msg)

View File

@@ -1,13 +1,7 @@
const config = require('../../config')
const { htmlToText } = require('html-to-text')
const dayjs = require('dayjs')
const timezone = require('dayjs/plugin/timezone')
const utc = require('dayjs/plugin/utc')
const { DateTime } = require('luxon')
dayjs.extend(utc)
dayjs.extend(timezone)
// class Event extends Model {}
module.exports = (sequelize, DataTypes) => {
const Event = sequelize.define('event', {
id: {
@@ -41,12 +35,18 @@ module.exports = (sequelize, DataTypes) => {
online_locations: { type: DataTypes.JSON, defaultValue: [] }
})
Event.prototype.toAP = function (username, locale, to = []) {
Event.prototype.toAP = function (settings, to = []) {
const username = settings.instance_name
const opt = {
zone: settings.instance_timezone,
locale: settings.instance_locale
}
const tags = this.tags && this.tags.map(t => t.tag.replace(/[ #]/g, '_'))
const plainDescription = htmlToText(this.description && this.description.replace('\n', '').slice(0, 1000))
const content = `
📍 ${this.place && this.place.name}
📅 ${dayjs.unix(this.start_datetime).tz().locale(locale).format('dddd, D MMMM (HH:mm)')}
📅 ${DateTime.fromSeconds(this.start_datetime).toFormat('EEEE, d MMMM (HH:mm)')}
${plainDescription}
`
@@ -69,8 +69,8 @@ module.exports = (sequelize, DataTypes) => {
name: this.title,
url: `${config.baseurl}/event/${this.slug || this.id}`,
type: 'Event',
startTime: dayjs.unix(this.start_datetime).tz().locale(locale).format(),
...( this.end_datetime ? { endTime : dayjs.unix(this.end_datetime).tz().locale(locale).format() } : {} ),
startTime: DateTime.fromSeconds(this.start_datetime, opt).toISO(),
...( this.end_datetime ? { endTime : DateTime.fromSeconds(this.end_datetime, opt).toISO() } : {} ),
location: {
name: this.place.name,
address: this.place.address,
@@ -83,7 +83,7 @@ module.exports = (sequelize, DataTypes) => {
name: '#' + tag,
href: `${config.baseurl}/tag/${tag}`
})),
published: dayjs(this.createdAt).utc().format(),
published: this.createdAt,
attributedTo: `${config.baseurl}/federation/u/${username}`,
to: ['https://www.w3.org/ns/activitystreams#Public'],
cc: [`${config.baseurl}/federation/u/${username}/followers`],

View File

@@ -15,6 +15,17 @@ let config = {
db: {},
user_locale: path.resolve(process.env.cwd || '', 'user_locale'),
upload_path: path.resolve(process.env.cwd || '', 'uploads'),
proxy: {
protocol: process.env.GANCIO_PROXY_PROTOCOL || '',
hostname: process.env.GANCIO_PROXY_HOSTNAME || '',
host: process.env.GANCIO_PROXY_HOST || '',
port: process.env.GANCIO_PROXY_PORT || '',
auth: {
username: process.env.GANCIO_PROXY_USERNAME || '',
password: process.env.GANCIO_PROXY_PASSWORD || ''
},
headers: process.env.GANCIO_PROXY_HEADERS && JSON.parse(process.env.GANCIO_PROXY_HEADERS) || {}
},
write (config_path= process.env.config_path || './config.json') {
delete config.status
return fs.writeFileSync(config_path, JSON.stringify(config, null, 2))

View File

@@ -89,9 +89,7 @@ const Helpers = {
to: ['https://www.w3.org/ns/activitystreams#Public'],
cc: [...recipients[sharedInbox], `${config.baseurl}/federation/u/${settingsController.settings.instance_name}/followers`],
actor: `${config.baseurl}/federation/u/${settingsController.settings.instance_name}`,
object: event.toAP(settingsController.settings.instance_name,
settingsController.settings.instance_locale,
recipients[sharedInbox])
object: event.toAP(settingsController.settings, recipients[sharedInbox])
}
body['@context'] = [
'https://www.w3.org/ns/activitystreams',

View File

@@ -34,7 +34,7 @@ router.get('/m/:event_id', async (req, res) => {
const event = await Event.findByPk(req.params.event_id, { include: [User, Tag, Place] })
if (!event) { return res.status(404).send('Not found') }
const eventAp = event.toAP(settingsController.settings.instance_name, settingsController.settings.instance_locale)
const eventAp = event.toAP(settingsController.settings)
eventAp['@context'] = [
"https://www.w3.org/ns/activitystreams"
]

View File

@@ -3,10 +3,8 @@ const { Event, Place, APUser, Tag } = require('../api/models/models')
const escape = require('lodash/escape')
const config = require('../config')
const log = require('../log')
const utc = require('dayjs/plugin/utc')
const dayjs = require('dayjs')
const settingsController = require('../api/controller/settings')
dayjs.extend(utc)
const { DateTime } = require('luxon')
module.exports = {
get (req, res) {
@@ -132,9 +130,9 @@ module.exports = {
type: 'Create',
to: ['https://www.w3.org/ns/activitystreams#Public'],
cc: [`${settings.baseurl}/federation/u/${name}/followers`],
published: dayjs(e.createdAt).utc().format(),
published: e.createdAt,
actor: `${settings.baseurl}/federation/u/${name}`,
object: e.toAP(name, settings.instance_locale)
object: e.toAP(settings)
}))
}
})

View File

@@ -87,7 +87,8 @@ module.exports = {
trusted_instances: settings.trusted_instances,
trusted_instances_label: settings.trusted_instances_label,
'theme.is_dark': settings['theme.is_dark'],
'theme.primary': settings['theme.primary'],
dark_colors: settings.dark_colors,
light_colors: settings.light_colors,
hide_thumbs: settings.hide_thumbs,
hide_calendar: settings.hide_calendar,
allow_geolocation: settings.allow_geolocation,
@@ -101,9 +102,6 @@ module.exports = {
allow_event_only_online: settings.allow_event_only_online,
allow_event_also_online: settings.allow_event_also_online
}
// set user locale
// res.locals.user_locale = settingsController.user_locale[res.locals.acceptedLocale]
dayjs.tz.setDefault(res.locals.settings.instance_timezone)
next()
},
@@ -199,9 +197,9 @@ module.exports = {
* It does supports ICS and H-EVENT
*/
async importURL(req, res) {
const URL = req.query.URL
const url = req.query.URL
try {
const response = await axios.get(URL)
const response = await axios.get(url)
const contentType = response.headers['content-type']
if (contentType.includes('text/html')) {
@@ -213,7 +211,7 @@ module.exports = {
const props = e.properties
let media = get(props, 'featured[0]')
if (media) {
media = url.resolve(URL, media)
media = URL.resolve(url, media)
}
return {
title: get(props, 'name[0]', ''),
@@ -255,16 +253,17 @@ module.exports = {
let cursor
if (n === -1) {
cursor = date.endOf('month')
cursor = cursor.day(weekday)
if (cursor.month() !== date.month()) {
cursor = cursor.subtract(1, 'week')
cursor = cursor.set({ weekday })
if (cursor.month !== date.month) {
cursor = cursor.minus({ days: 7 })
}
} else {
cursor = date.startOf('month')
cursor = cursor.add(cursor.day() <= date.day() ? n - 1 : n, 'week')
cursor = cursor.day(weekday)
cursor = cursor.plus({ days: cursor.weekday <= date.weekday ? (n-1) * 7 : n * 7})
cursor = cursor.set({ weekday })
}
cursor = cursor.hour(date.hour()).minute(date.minute()).second(0)
cursor = cursor.set({ hour: date.hour, minute: date.minute, second: 0 })
log.debug(cursor)
return cursor
},

View File

@@ -1,12 +1,12 @@
const config = require('../server/config')
const db = require('./api/models/index')
const log = require('../server/log')
const { Settings } = require('luxon')
db.initialize()
const settingsController = require('./api/controller/settings')
const initialize = {
// close connections/port/unix socket
async shutdown (exit = true) {
@@ -26,9 +26,6 @@ const initialize = {
},
async start () {
const dayjs = require('dayjs')
const timezone = require('dayjs/plugin/timezone')
dayjs.extend(timezone)
if (config.status == 'CONFIGURED') {
await db.sequelize.authenticate()
log.debug('Running migrations')
@@ -57,10 +54,11 @@ const initialize = {
await settingsController.load()
}
dayjs.tz.setDefault(settingsController.settings.instance_timezone)
Settings.defaultLocale = settingsController.settings.instance_locale
Settings.defaultZone = settingsController.settings.instance_timezone
let TaskManager
if (config.status === 'READY' && process.env.NODE_ENV == 'production') {
if (config.status === 'READY' && process.env.NODE_ENV != 'test') {
TaskManager = require('../server/taskManager').TaskManager
TaskManager.start()
}

View File

@@ -7,8 +7,13 @@ const helpers = require('./helpers')
const api = require('./api')
async function main () {
const log = require('./log')
await initialize.start()
try {
await initialize.start()
} catch (e) {
log.error('[ERROR]' + e)
}
app.use([
helpers.initSettings,
@@ -19,7 +24,6 @@ async function main () {
// const promBundle = require('express-prom-bundle')
// const metricsMiddleware = promBundle({ includeMethod: true })
const log = require('./log')
app.enable('trust proxy')