From 6ee712492202beac5b72fc83002fce6b64148f19 Mon Sep 17 00:00:00 2001 From: Kumi Date: Sun, 2 Jun 2024 20:38:26 +0200 Subject: [PATCH 01/27] feat(finances): add new server costs for June 2024 Introduced a new financial record for server costs in June, ensuring accurate and up-to-date tracking of our operating expenses. This change addresses the need for precise financial monitoring and forecasting as our infrastructure scales. Continuously updating this data is crucial for maintaining budget accuracy and allocating resources wisely. --- data/finances.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/data/finances.json b/data/finances.json index b047d7a..0e66932 100644 --- a/data/finances.json +++ b/data/finances.json @@ -28,6 +28,11 @@ "Domain Names": {}, "Operating Expenses": {}, "Conversions": {} + }, + "6": { + "Server Costs": { + "EUR": -21.94 + } } } } \ No newline at end of file From afae1a0531f9973bbe84d199ef57cded1c6314d9 Mon Sep 17 00:00:00 2001 From: Kumi Date: Sun, 2 Jun 2024 20:43:53 +0200 Subject: [PATCH 02/27] feat: Add uWSGI config for privatecoffee-dev Introduce a new uWSGI configuration for the Private.coffee development environment. This setup specifies the main application module, user/group IDs, process management settings, Python plugin usage, virtual environment path, working directory, environment variables, and socket ownership settings. It is tailored to streamline development workflows by ensuring that the server environment closely mirrors production settings while incorporating development-specific features such as debug mode. This addition marks a foundational step in improving local development setup and potentially eases the transition between development and production environments. This configuration uses environment variables to flag development mode, enabling enhanced logging and debug capabilities without affecting the production settings. It also outlines the setup for socket communication and permissions, ensuring secure and efficient inter-process communication during development. The choice of uWSGI parameters and settings was made to optimize resource usage and facilitate a more controlled development environment, aiming for consistency across development and deployment stages. --- contrib/uwsgi/privatecoffee-dev.ini | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 contrib/uwsgi/privatecoffee-dev.ini diff --git a/contrib/uwsgi/privatecoffee-dev.ini b/contrib/uwsgi/privatecoffee-dev.ini new file mode 100644 index 0000000..ce060f6 --- /dev/null +++ b/contrib/uwsgi/privatecoffee-dev.ini @@ -0,0 +1,16 @@ +[uwsgi] +module = main:app + +uid = %n +gid = %n +master = true +processes = 5 + +plugins = python3 +virtualenv = /srv/%n/venv/ +chdir = /srv/%n/ + +env = PRIVATECOFFEE_DEV=true + +http-socket = /var/run/uwsgi/%n.sock +chown-socket = caddy \ No newline at end of file From b013430d8b22b07385fb388d6c7ae85660ad7ad3 Mon Sep 17 00:00:00 2001 From: Kumi Date: Sun, 2 Jun 2024 20:45:53 +0200 Subject: [PATCH 03/27] fix: update membership button text for inclusivity Changed the text on the membership button from "JOIN & REBEL" to "JOIN & SUPPORT" in the base template. This adjustment better reflects the community spirit and aims to be more inclusive, encouraging broader participation. The update is part of ongoing efforts to make our digital spaces more welcoming and representative of our values. --- templates/base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/base.html b/templates/base.html index 2a5fa97..cfe2dab 100644 --- a/templates/base.html +++ b/templates/base.html @@ -48,7 +48,7 @@ JOIN & REBEL + JOIN & SUPPORT {% if warning %}{{ warning|safe }}{% endif %} From b3ae436679661c68a497dfc20b5189c2af0f904d Mon Sep 17 00:00:00 2001 From: Kumi Date: Mon, 3 Jun 2024 06:55:38 +0200 Subject: [PATCH 04/27] feat: enable index and simple index display for Rallly Removed restrictions on a Rallly that previously excluded it from being displayed on the index pages. This change makes the service more visible and accessible to users, enhancing discoverability. This adjustment aligns with efforts to improve the user experience by ensuring all relevant services are easily findable. --- data/services.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/services.json b/data/services.json index 036a467..e1be581 100644 --- a/data/services.json +++ b/data/services.json @@ -305,8 +305,8 @@ } ], "icon": "calendar", - "exclude_from_index": true, - "exclude_from_simple": true + "exclude_from_index": false, + "exclude_from_simple": false }, { "name": "LibreY", From 1a10e8968bb8bb95b654310d27a1f7bfe08d5396 Mon Sep 17 00:00:00 2001 From: Kumi Date: Mon, 3 Jun 2024 16:12:21 +0200 Subject: [PATCH 05/27] feat: Enhance financial transparency Introduced detailed financial reporting on a per-category basis, including notes for specific expenses and administrative costs in the data model. Enhanced the financial transparency feature by integrating a monthly financial report generator in the backend, enabling dynamic generation and display of detailed financial reports on the website. This commit also includes a new transparency report page, enriching user engagement with detailed insights into financial allocations and expenditures. - Refactored finance-related data structures to include notes about specific financial activities. - Extended the financial reporting capabilities to generate and display detailed notes and categorizations of expenses and incomes, improving transparency. - Updated the UI to display these detailed reports, ensuring that users have access to comprehensive financial information. This change aligns with our commitment to transparency and accountability by providing clear, detailed financial information to our members and donors. --- data/finances.json | 17 ++++------ helpers/finances.py | 66 ++++++++++++++++++++++++------------- main.py | 22 +++++++++++++ templates/membership.html | 5 +++ templates/transparency.html | 25 ++++++++++++++ 5 files changed, 103 insertions(+), 32 deletions(-) create mode 100644 templates/transparency.html diff --git a/data/finances.json b/data/finances.json index 0e66932..2b2b7d5 100644 --- a/data/finances.json +++ b/data/finances.json @@ -4,15 +4,14 @@ "Membership Fees": { "EUR": 365 }, - "Donations": {}, "Server Costs": { "EUR": -216.57 }, "Domain Names": {}, - "Operating Expenses": { - "EUR": -36.10 - }, - "Conversions": {} + "Administrative Expenses": { + "EUR": -36.10, + "Notes": "Administrative fee for the formation of the association" + } }, "5": { "Membership Fees": { @@ -23,11 +22,9 @@ "XMR": 0.447661805527 }, "Server Costs": { - "EUR": -430.04 - }, - "Domain Names": {}, - "Operating Expenses": {}, - "Conversions": {} + "EUR": -430.04, + "Notes": "Includes setup costs and two monthly payments for new server" + } }, "6": { "Server Costs": { diff --git a/helpers/finances.py b/helpers/finances.py index e4a0b32..b55111f 100644 --- a/helpers/finances.py +++ b/helpers/finances.py @@ -9,6 +9,7 @@ def get_latest_month(data): return int(latest_month), int(latest_year) + def get_transparency_data(data, year=None, month=None): if year is None: year = max(data.keys()) @@ -23,6 +24,7 @@ def get_transparency_data(data, year=None, month=None): balances = {} incomes = {} expenses = {} + notes = {} start_balance = {} end_balance = {} @@ -37,41 +39,51 @@ def get_transparency_data(data, year=None, month=None): # If the month is the one we are interested in, capture the start balance if int(y) == int(year) and int(m) == int(month): - start_balance = {k: Decimal(v) for k, v in balances.items()} + start_balance = { + k: Decimal(v) for k, v in balances.items() if k != "Notes" + } for category in data[y][m]: for currency, amount in data[y][m][category].items(): - if currency not in balances: - balances[currency] = Decimal(0) - balances[currency] += Decimal(str(amount)) + if currency == "Notes": + if int(y) == int(year) and int(m) == int(month): + notes[category] = amount + else: + if currency not in balances: + balances[currency] = Decimal(0) + balances[currency] += Decimal(str(amount)) - # Track incomes and expenses - if int(y) == int(year) and int(m) == int(month): - if Decimal(str(amount)) > 0: - if category not in incomes: - incomes[category] = {} - if currency not in incomes[category]: - incomes[category][currency] = Decimal(0) - incomes[category][currency] += Decimal(str(amount)) - else: - if category not in expenses: - expenses[category] = {} - if currency not in expenses[category]: - expenses[category][currency] = Decimal(0) - expenses[category][currency] += Decimal(str(amount)) + # Track incomes and expenses + if int(y) == int(year) and int(m) == int(month): + if Decimal(str(amount)) > 0: + if category not in incomes: + incomes[category] = {} + if currency not in incomes[category]: + incomes[category][currency] = Decimal(0) + incomes[category][currency] += Decimal(str(amount)) + else: + if category not in expenses: + expenses[category] = {} + if currency not in expenses[category]: + expenses[category][currency] = Decimal(0) + expenses[category][currency] += Decimal(str(amount)) # If the month is the one we are interested in, capture the end balance if int(y) == int(year) and int(m) == int(month): - end_balance = {k: Decimal(v) for k, v in balances.items()} + end_balance = { + k: Decimal(v) for k, v in balances.items() if k != "Notes" + } # Calculate accumulated sums of incomes and expenses accumulated_incomes = { currency: sum(incomes[cat].get(currency, Decimal(0)) for cat in incomes) for currency in balances + if currency != "Notes" } accumulated_expenses = { currency: sum(expenses[cat].get(currency, Decimal(0)) for cat in expenses) for currency in balances + if currency != "Notes" } return { @@ -81,6 +93,7 @@ def get_transparency_data(data, year=None, month=None): "expenses": expenses, "accumulated_incomes": accumulated_incomes, "accumulated_expenses": accumulated_expenses, + "notes": notes, } @@ -94,7 +107,7 @@ def generate_transparency_table(result, currencies=None): + list(data["accumulated_incomes"].keys()) + list(data["accumulated_expenses"].keys()) ) - - {"EUR"} + - {"EUR", "Notes"} ) ) @@ -152,7 +165,8 @@ def generate_transparency_table(result, currencies=None): # Add income rows for category, transactions in result["incomes"].items(): - html += f"{category}" + has_notes = result["notes"].get(category) + html += f"{category}{'*' if has_notes else ''}" for currency in currencies: value = transactions.get(currency, "") if value != "": @@ -163,7 +177,8 @@ def generate_transparency_table(result, currencies=None): # Add expense rows for category, transactions in result["expenses"].items(): - html += f"{category}" + has_notes = result["notes"].get(category) + html += f"{category}{'*' if has_notes else ''}" for currency in currencies: value = transactions.get(currency, "") if value != "": @@ -198,4 +213,11 @@ def generate_transparency_table(result, currencies=None): """ + if result["notes"]: + html += "

Notes:

" + html += "
    " + for category, footnote in result["notes"].items(): + html += f"
  • {category}: {footnote}
  • " + html += "
" + return html diff --git a/main.py b/main.py index 6c9a279..ae42d8f 100644 --- a/main.py +++ b/main.py @@ -69,6 +69,28 @@ def catch_all(path): } ) + if path == "transparency": + finances = json.loads( + (pathlib.Path(__file__).parent / "data" / "finances.json").read_text() + ) + + finance_data = {} + + for year in sorted(finances.keys(), reverse=True): + for month in sorted(finances[year].keys(), reverse=True): + if year not in finance_data: + finance_data[year] = {} + print(get_transparency_data(finances, year, month)) + finance_data[year][month] = generate_transparency_table( + get_transparency_data(finances, year, month) + ) + + kwargs.update( + { + "finances": finance_data, + } + ) + return render_template(f"{path}.html", **kwargs) except TemplateNotFound: diff --git a/templates/membership.html b/templates/membership.html index dc56848..a5fd904 100644 --- a/templates/membership.html +++ b/templates/membership.html @@ -85,6 +85,11 @@ donations are being used.

{{ finances|safe }}
+

+ Want to know how we got here? Check out all of our + transparency reports for more + information. +

diff --git a/templates/transparency.html b/templates/transparency.html new file mode 100644 index 0000000..59626c2 --- /dev/null +++ b/templates/transparency.html @@ -0,0 +1,25 @@ +{% extends "base.html" %} {% block title %}Membership / Donations{% endblock %} +{% block content %} +
+
+

Transparency

+

+ Private.coffee is funded by its members and donations. We believe in + transparency and accountability. Below you can find financial reports for + each month since our inception. +

+
+ + {% for year, year_data in finances.items() %} + {% for month, month_data in year_data.items() %} +
+
+
Transparency Report for {{ month }}/{{ year }}
+
{{ month_data|safe }}
+
+
+ {% endfor %} + {% endfor %} + +
+{% endblock %} From 5e20c5f225c93f25968f13ee75ddadab436214c2 Mon Sep 17 00:00:00 2001 From: Kumi Date: Mon, 3 Jun 2024 18:36:48 +0200 Subject: [PATCH 06/27] feat(finances): Add membership fees to budget Introduce a new "Membership Fees" category in the financial data, with an initial amount of 50 EUR. This update is crucial for providing a more comprehensive view of our income streams alongside our expenditures, ensuring our budget reflects all financial aspects accurately. This addition aids in better financial planning and resource allocation for future projects and needs. --- data/finances.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/data/finances.json b/data/finances.json index 2b2b7d5..af8c9fb 100644 --- a/data/finances.json +++ b/data/finances.json @@ -27,6 +27,9 @@ } }, "6": { + "Membership Fees": { + "EUR": 50 + }, "Server Costs": { "EUR": -21.94 } From e37aff88a37a1a98cc955325d6f6abc6b9635bec Mon Sep 17 00:00:00 2001 From: Kumi Date: Wed, 5 Jun 2024 14:01:54 +0200 Subject: [PATCH 07/27] feat(finances): increase server costs in budget Updated the budget to reflect a more accurate estimation of monthly server costs. The increase from EUR 21.94 to EUR 69.67 addresses recent upgrades and higher usage rates, ensuring the budget more closely matches operational expenditures. This change is crucial for maintaining financial transparency and aids in future planning. --- data/finances.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/finances.json b/data/finances.json index af8c9fb..112b5dc 100644 --- a/data/finances.json +++ b/data/finances.json @@ -31,7 +31,7 @@ "EUR": 50 }, "Server Costs": { - "EUR": -21.94 + "EUR": -69.67 } } } From 103265018558dd8ded06bd8dafbb9704eca37ce5 Mon Sep 17 00:00:00 2001 From: Kumi Date: Fri, 7 Jun 2024 18:13:00 +0200 Subject: [PATCH 08/27] feat(index.html): Update membership CTA messaging Updated the call-to-action text from "Join and rebel" to "Join or donate" on the homepage membership section. This change aims to communicate a more inclusive and supportive stance towards potential members, encouraging broader participation in the open source community. The adjustment reflects a strategic shift to emphasize collaboration and support over confrontation. --- templates/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/index.html b/templates/index.html index 19c0522..0a8cb87 100644 --- a/templates/index.html +++ b/templates/index.html @@ -62,7 +62,7 @@
-

Join and rebel

+

Join and support us

Be a part of the open source community!
Learn more
From a874ae944ad2c135bf4befaa23bc727979c02258 Mon Sep 17 00:00:00 2001 From: Kumi Date: Fri, 7 Jun 2024 18:13:54 +0200 Subject: [PATCH 09/27] feat(index.html): update call-to-action text Updated the call-to-action text in the card body from "Join and support us" to "Join or donate" to offer website visitors a clearer choice between joining the community or making a donation. This change aims to streamline user decisions and potentially increase conversions by directly addressing the primary actions users can take to support the open-source community. --- templates/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/index.html b/templates/index.html index 0a8cb87..f36b59b 100644 --- a/templates/index.html +++ b/templates/index.html @@ -62,7 +62,7 @@
-

Join and support us

+

Join or donate

Be a part of the open source community!
Learn more
From 2b7ab71476a8054f8c4ab4663a54c75c82b8fb75 Mon Sep 17 00:00:00 2001 From: Kumi Date: Fri, 7 Jun 2024 18:54:15 +0200 Subject: [PATCH 10/27] feat(icons): add LGBTIQ+ rainbow icon Introduced a new LGBTIQ+ rainbow icon SVG to enhance visual representation and inclusivity on the platform. This update includes the integration of the icon within the base template, specifically at the footer section to signal support for the LGBTIQ+ community. This change aligns with our commitment to diversity and inclusiveness. --- assets/dist/icons/rainbow.svg | 13 +++++++++++++ templates/base.html | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 assets/dist/icons/rainbow.svg diff --git a/assets/dist/icons/rainbow.svg b/assets/dist/icons/rainbow.svg new file mode 100644 index 0000000..196258f --- /dev/null +++ b/assets/dist/icons/rainbow.svg @@ -0,0 +1,13 @@ + + LGBTIQ+ + + + + + + + + + LGBTIQ+ + + \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index cfe2dab..902ba11 100644 --- a/templates/base.html +++ b/templates/base.html @@ -89,8 +89,8 @@ class="text-muted d-flex justify-content-between align-items-center pt-3" >

Made with ❤️ and ☕ by Private.coffee

+

{{ "rainbow" | icon | safe }}

-
From abb6c8def06fe1894e05d0aeffeeda643e7d7310 Mon Sep 17 00:00:00 2001 From: Kumi Date: Sat, 8 Jun 2024 09:16:42 +0200 Subject: [PATCH 11/27] feat(base.html): improve navbar responsiveness Removed the 'sticky-top' and 'navbar-shrink' classes from the navbar in base.html to enhance its responsiveness and adaptability across different screen sizes. This change aims to offer a more streamlined user experience by ensuring the navbar's style and position remain consistent and unobtrusive, particularly on mobile devices where screen real estate is limited. --- templates/base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/base.html b/templates/base.html index 902ba11..2b6ce88 100644 --- a/templates/base.html +++ b/templates/base.html @@ -17,7 +17,7 @@