Keel - LDH Middleware issueshttps://source.puri.sm/liberty/host/middleware/-/issues2018-11-14T14:15:30Zhttps://source.puri.sm/liberty/host/middleware/-/issues/20Use settings.SITE_TITLE in base.html template2018-11-14T14:15:30ZDavid SeawardUse settings.SITE_TITLE in base.html templateThe `home.html` template currently accesses `settings.SITE_TITLE` via `views.py`. It sets this value in:
* `<meta name="application-name" content="{{ site_title }}">`
* `<h1><img src="..." alt="{{ site_title }}"/></h1>`
We need to s...The `home.html` template currently accesses `settings.SITE_TITLE` via `views.py`. It sets this value in:
* `<meta name="application-name" content="{{ site_title }}">`
* `<h1><img src="..." alt="{{ site_title }}"/></h1>`
We need to set the same values in the `base.html` template.
The meta tag is important, as this defines the name of the web application to user agents that understand it (e.g. GNOME Web aka Epiphany).https://source.puri.sm/liberty/host/middleware/-/issues/47[review] Welcoming to experienced Django developers?2018-12-04T14:23:28ZDavid Seaward[review] Welcoming to experienced Django developers?**User story:** I am an experienced Django developer. I want to easily understand the codebase, so that I can start contributing quickly.
**User story:** I am less experienced developer. I expect the codebase to use well known convent...**User story:** I am an experienced Django developer. I want to easily understand the codebase, so that I can start contributing quickly.
**User story:** I am less experienced developer. I expect the codebase to use well known conventions, or document peculiarities when this is not the case, so that I can easily look up anything I don't understand.
I'd appreciate a quick review of the codebase, highlighting any issues that a Django developer would not understand or dislike.David SeawardDavid Seawardhttps://source.puri.sm/liberty/host/middleware/-/issues/36Handle closed registration2019-08-19T15:06:43ZDavid SeawardHandle closed registrationGiven the user is logged in
When the user visits any page
Then display "Logged in as" message and links
Given `REGISTRATION_OPEN=True`
When the user visits any page
Then display "Log in" link
And display "Register" link...Given the user is logged in
When the user visits any page
Then display "Logged in as" message and links
Given `REGISTRATION_OPEN=True`
When the user visits any page
Then display "Log in" link
And display "Register" link
Given `REGISTRATION_OPEN=False`
When the user visits any page
Then display "Log in" link
But do not display "Register" link
Notes:
* As a fallback, create a "registration_closed" template file.
* Also handle user visiting registration URL when `REGISTRATION_OPEN=False`
Boring badger 2https://source.puri.sm/liberty/host/middleware/-/issues/59Add DOAP file2019-08-21T12:31:56ZDavid SeawardAdd DOAP filePer [Librem 5 contribution guidelines](https://developer.puri.sm/Contributing.html) add a DOAP file to this repo.
See https://source.puri.sm/Librem5/phosh/blob/master/phosh.doap for an example.Per [Librem 5 contribution guidelines](https://developer.puri.sm/Contributing.html) add a DOAP file to this repo.
See https://source.puri.sm/Librem5/phosh/blob/master/phosh.doap for an example.Boring badger 2https://source.puri.sm/liberty/host/middleware/-/issues/61Handle username with @domain suffix2018-11-14T14:16:02ZDavid SeawardHandle username with @domain suffix**Steps to reproduce:**
* Visit PSH login page
* Enter domain-less username ("user")
* Enter correct passphrase ("correct horse battery staple")
**What should happen:**
* User is logged in
**What happens intead:**
* Error message: "...**Steps to reproduce:**
* Visit PSH login page
* Enter domain-less username ("user")
* Enter correct passphrase ("correct horse battery staple")
**What should happen:**
* User is logged in
**What happens intead:**
* Error message: "Enter a valid username. Must start with a letter, followed by letters and numbers. No punctuation or special characters."
**Solution:**
* UsernameValidator in purist/models.py is a simple RegexValidator. It should be updated to handle a `"@" + settings.SITE_DOMAIN` suffix. For example, normalize the username before validating.
**Notes:**
* Username-with-domain is our preferred form for usernames.https://source.puri.sm/liberty/host/middleware/-/issues/62Implement URL-based l10n2018-11-14T14:16:04ZDavid SeawardImplement URL-based l10nDjango provides a simple mechanism for page localization via the URL, e.g. `example.com/en/stub`, see [Internationalization: in URL patterns](https://docs.djangoproject.com/en/2.0/topics/i18n/translation/#module-django.conf.urls.i18n)
I...Django provides a simple mechanism for page localization via the URL, e.g. `example.com/en/stub`, see [Internationalization: in URL patterns](https://docs.djangoproject.com/en/2.0/topics/i18n/translation/#module-django.conf.urls.i18n)
Implement this so that middleware URLs are all explicitly localized (`en` is not treated differently).https://source.puri.sm/liberty/host/middleware/-/issues/67Generic user hash2019-06-05T16:39:16ZDavid SeawardGeneric user hashSometimes we need to generate our own hash value for a user. To implement this:
* Add `PEPPER` as a system config value
* Add `salt` as an attribute on the User model (populated when User object is created)
* Add `hash` as a function on...Sometimes we need to generate our own hash value for a user. To implement this:
* Add `PEPPER` as a system config value
* Add `salt` as an attribute on the User model (populated when User object is created)
* Add `hash` as a function on the User model:
```
def hash(input, hash_function="bcrypt"):
if hash_function == "bcrypt":
return bcrypt.hashpw(input, user.salt + system.PEPPER)
else:
throw UnknownFunctionError
```Future buckethttps://source.puri.sm/liberty/host/middleware/-/issues/68Parameterise footer in base.html2019-08-19T15:06:12ZDavid SeawardParameterise footer in base.htmlIn `limitmonitor/jinja2/limitmonitor/userlimit.html` we parameterize the operator details in the footer.
```
<em>{{ site_title }}</em> provided by <a href="{{ site_provider_link }}">{{ site_provider }}</a>
```
Let's do the same in `lda...In `limitmonitor/jinja2/limitmonitor/userlimit.html` we parameterize the operator details in the footer.
```
<em>{{ site_title }}</em> provided by <a href="{{ site_provider_link }}">{{ site_provider }}</a>
```
Let's do the same in `ldapregister/templates/base.html`Boring badger 2https://source.puri.sm/liberty/host/middleware/-/issues/69Refactor ldap_register and cart modules2019-06-05T16:38:54ZDavid SeawardRefactor ldap_register and cart modulesWe don't perform a simple LDAP registration any more, and we will continue adding special sauce to the registration process. So, it makes sense to combine these modules into a single `ldh_register` module.We don't perform a simple LDAP registration any more, and we will continue adding special sauce to the registration process. So, it makes sense to combine these modules into a single `ldh_register` module.Future buckethttps://source.puri.sm/liberty/host/middleware/-/issues/70Optional LDAP attributes2019-06-05T16:38:38ZDavid SeawardOptional LDAP attributesA particular LDH may have specific LDAP requirements, such as every user entry needing particular LDAP attributes.
We need to support:
* configuring a list of attributes and their default values
* adding and setting these attributes on...A particular LDH may have specific LDAP requirements, such as every user entry needing particular LDAP attributes.
We need to support:
* configuring a list of attributes and their default values
* adding and setting these attributes on new LDAP accounts
Specifically we need to be able to add `gosaMailDeliveryMode = []`.Future buckethttps://source.puri.sm/liberty/host/middleware/-/issues/71Implement a re-authenticate button2019-03-15T12:30:56ZBirin SanchezImplement a re-authenticate buttonKeel should ask the user to re-enter her credentials when she tries to modify important settings. For example when the user wants to activate/deactivate certain services in her profile page.Keel should ask the user to re-enter her credentials when she tries to modify important settings. For example when the user wants to activate/deactivate certain services in her profile page.https://source.puri.sm/liberty/host/middleware/-/issues/75[cleanup] Remove references to librem.one and puri.sm2019-09-03T10:45:22ZDavid Seaward[cleanup] Remove references to librem.one and puri.smldh_middleware should be a host-neutral and provider-neutral solution. Please review for any references that have crept in and remove them. (References to authorship and source code should obviously remain.)ldh_middleware should be a host-neutral and provider-neutral solution. Please review for any references that have crept in and remove them. (References to authorship and source code should obviously remain.)Boring badger 2https://source.puri.sm/liberty/host/middleware/-/issues/81[tunnel/app] Alert user if their tunnel is not active2019-08-19T15:07:07ZDavid Seaward[tunnel/app] Alert user if their tunnel is not activeI imagine a workflow like this:
BASIC
* User creates basic account.
* User launches Librem Tunnel and enters credentials.
* User attempts to connect.
* User receives message "This account does not have a tunnel service."
COMPLETE (INA...I imagine a workflow like this:
BASIC
* User creates basic account.
* User launches Librem Tunnel and enters credentials.
* User attempts to connect.
* User receives message "This account does not have a tunnel service."
COMPLETE (INACTIVE)
* User creates complete account. Tunnel is inactive by default.
* User launches Librem Tunnel and enters credentials.
* User attempts to connect.
* User receives message "Tunnel service is not active. Please visit your profile to activate it."
COMPLETE (ACTIVE)
* User creates complete account. Tunnel is inactive by default.
* User activates tunnel.
* User launches Librem Tunnel and enters credentials.
* User attempts to connect.
* It works.
**Suggested solution:**
* A REST endpoint that returns a status of "unavailable", "inactive" or "active".
* App logic to match.
/cc @birin.sanchez @thomas.markiewiczFeisty first launchhttps://source.puri.sm/liberty/host/middleware/-/issues/86Parameterise billing/bundle on registration page2019-09-13T08:37:33ZDavid SeawardParameterise billing/bundle on registration page## User story
I am an unregistered user. I want to pick my bundle before my billing period, to reduce cognitive overhead.
## Suggested solution
We are moving the period choice (monthly/annual) from the front page to the registration p...## User story
I am an unregistered user. I want to pick my bundle before my billing period, to reduce cognitive overhead.
## Suggested solution
We are moving the period choice (monthly/annual) from the front page to the registration page. The bundle choice (basic/complete/family) remains on the front page.
Let's fully parameterize the registration page, but hide irrelevant fields so that we can easily adapt to other workflows.
The business logic doesn't need to account for confusing or invalid definitions, filters and layouts. A mindless rendering of the configuration with late-stage errors is sufficient. Defining a sensible configuration will be the responsibility of the operator.
### Basic layout
* Add two new fields to the registration page, between `passphrase` and `captcha`. They should be `bundle_choice` and `period_choice`. They may be pure-GUI fields not corresponding to database fields.
* Under `period_choice` should be a text field that updates when the user changes either `bundle_choice` or `period_choice`. Every combination has a unique description and associated WooCommerce cart URL:
| Bundle | Period | Description | Cart URL |
| -------- | ------- | ----------- | -------- |
| Basic | Monthly | Just Chat and Social. Free now and forever. | https://shop.example.com/add_to_cart/1/ |
| Basic | Annual | Invalid. Please choose Basic/Monthly. | NULL |
| Complete | Monthly | All services for $7.99 per month. | .../3/ |
| Complete | Annual | All services for $5.99 per month (billed annually). | .../4/ |
| Family | Monthly | Five complete accounts for $14.99 per month. | .../5/ |
| Family | Annual | Five complete accounts for $11.25 per month (billed annually). | .../6/ |
* Marketing will request changes *Description*, so these values should be stored in config for easy editing.
* The basic layout shows all fields and all options.
* When the user clicks "Billing >>" they are redirected to the WooCommerce URL associated with the bundle/period combination.
### Filtered layout
Define special URLs that adjust the layout to hide fields and limit which options are displayed. For example:
**Complete filter**
* Limit options to "Complete | Monthly" and "Complete | Annual"
* Hide the `bundle_choice` field
* This means the user has already picked "Complete" and is choosing between Monthly and Annual
### Single layout (special filter)
There will be a period when we need to keep using the current workflow. A single layout filter replicates the current workflow:
**Complete Monthly filter**
* Limit options to "Complete | Monthly"
* Hide both the `bundle_choice` and `period_choice` fields and the description
* This means the user has already chosen, and is simply registering
### Basic layout (special filter)
Basic users do not need to fill in billing details. They should have a single layout filter *and* skip the WooCommerce step.
**Basic Monthly filter**
* Limit options to "Basic | Monthly"
* Hide both the `bundle_choice` and `period_choice` fields and the description
* Display "REGISTER >>" instead of "BILLING >>" and immediately redirect to account page
* A WooCommerce shop account must still be created, with the recovery address as the billing address
Feisty first launchBirin SanchezBirin Sanchez2019-09-13https://source.puri.sm/liberty/host/middleware/-/issues/87Update stylesheet for radio buttons in forms2020-05-06T16:26:55ZDavid SeawardUpdate stylesheet for radio buttons in formsWe have added some radio buttons to forms. They appear with a bullet point and radio button, which is confusing, or at least ugly. Please update the stylesheet accordingly.
![image](/uploads/1d4ca58a0c8172ea0f8c54089ee3b845/image.png)We have added some radio buttons to forms. They appear with a bullet point and radio button, which is confusing, or at least ugly. Please update the stylesheet accordingly.
![image](/uploads/1d4ca58a0c8172ea0f8c54089ee3b845/image.png)Feisty first launchNoe Nietonoe.nieto@puri.smNoe Nietonoe.nieto@puri.sm2020-02-21https://source.puri.sm/liberty/host/middleware/-/issues/88Migration path for pre-existing WooCommerce accounts2020-05-06T16:26:54ZDavid SeawardMigration path for pre-existing WooCommerce accounts**User story:** I am a returning customer. When I subscribe, I want to use my existing shop account, so that I can see all my orders in one place.
**Suggested solution:** Custom registration page for existing WooCommerce users prompting...**User story:** I am a returning customer. When I subscribe, I want to use my existing shop account, so that I can see all my orders in one place.
**Suggested solution:** Custom registration page for existing WooCommerce users prompting for:
* Existing address
* Existing passphrase
* Librem One address
* CAPTCHA
```
Given there is an existing account
And the Librem One address is available
When the user enters the correct credentials
Then create a gratis Librem One account
And set the recovery email to the old address
And update the WooCommerce account details
```
...the user can now migrate to a gratis account, and upgrade to a paid account if they want to.
**Notes:**
We currently disallow recovery emails that match an existing WooCommerce account. Replace this error message with something like:
> This recovery email is in use at the shop. [Please migrate your account.]()
Additionally, we should offer a migration link from within WooCommerce. (New ticket once this one is complete.)Boring badgerDavid SeawardDavid Seaward2020-03-09https://source.puri.sm/liberty/host/middleware/-/issues/90Report: Invalid accounts2019-10-16T12:52:38ZDavid SeawardReport: Invalid accounts**User story:** I am an operator. I want to review any invalid accounts, so I can resolve any issues.
**Suggested solution:**
* A report requiring admin access. (More reports will follow.)
* A single section for now "Expired accounts"....**User story:** I am an operator. I want to review any invalid accounts, so I can resolve any issues.
**Suggested solution:**
* A report requiring admin access. (More reports will follow.)
* A single section for now "Expired accounts". Include all accounts that have expired, but are still active. (More sections will follow.)Boring badgerBirin SanchezBirin Sanchez2019-11-29https://source.puri.sm/liberty/host/middleware/-/issues/91Reword message shown after an upgrade/downgrade is started2019-11-12T14:08:03ZBirin SanchezReword message shown after an upgrade/downgrade is started# User story
I'm a Librem One customer who wants to downgrade from Complete to Basic subscription. After starting the downgrade process Librem One 'Manage subscriptions' link shows me this:
![image](/uploads/5deb340df917a463f78297a2205...# User story
I'm a Librem One customer who wants to downgrade from Complete to Basic subscription. After starting the downgrade process Librem One 'Manage subscriptions' link shows me this:
![image](/uploads/5deb340df917a463f78297a2205cb29b/image.png)
The "Use this link to pay." phrase is confusing because the Basic subscription is free. That link takes you to the shop to pay $0.
# Solution
I suggest we:
* Rephrase that page
or:
* Make Basic downgrades automatic when the user triggers them so no need to go through the shop to pay $0.
/cc @david.seawardBirin SanchezBirin Sanchezhttps://source.puri.sm/liberty/host/middleware/-/issues/92Update django-ldapdb to the latest version once our changes get accepted2023-05-24T11:46:00ZBirin SanchezUpdate django-ldapdb to the latest version once our changes get acceptedWe found out that the way `django-ldapdb` handled LDAP entries updates were sub-optimal when using LDAP groups with thousands of members. To solve that we created a PR with a solution:
https://github.com/django-ldapdb/django-ldapdb/pull...We found out that the way `django-ldapdb` handled LDAP entries updates were sub-optimal when using LDAP groups with thousands of members. To solve that we created a PR with a solution:
https://github.com/django-ldapdb/django-ldapdb/pull/198
If this PR get accepted it will probably make it to latest `django-ldapdb` version, therefore we will need to update the packages dependencies of the project to start using it.Birin SanchezBirin Sanchezhttps://source.puri.sm/liberty/host/middleware/-/issues/94Expire bundle changes that haven't been finished in 2 weeks2020-01-13T11:27:24ZBirin SanchezExpire bundle changes that haven't been finished in 2 weeks# User story
I'm a user that wants to upgrade/downgrade my current subscription. I click on 'Manage Subscription' link in my profile page and follow the instructions to upgrade/downgrade but then I decide that I don't want to do the upg...# User story
I'm a user that wants to upgrade/downgrade my current subscription. I click on 'Manage Subscription' link in my profile page and follow the instructions to upgrade/downgrade but then I decide that I don't want to do the upgrade/downgrade.
If later I decide to do a different upgrade/downgrade I will need to contact support to deal with the change as the middleware does not allow me to cancel a upgrade/downgrade and these never expire.
# Solution
Add new logic to `process_bundle_changes()` so bundle changes older than 2 weeks won't be processed and the new order created for it is cancelled.
Add an button in 'Manage Subscription' page so the user can cancel the upgrade/downgrade if is still pending.
/cc @david.seawardBirin SanchezBirin Sanchez