Skip to content

Commit e53f366

Browse files
Merge pull request #79 from acaptutorials/dev
1.3.0
2 parents 96cdcb4 + e65f014 commit e53f366

File tree

17 files changed

+227
-21
lines changed

17 files changed

+227
-21
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ ACAP Bicol (ACAP 2.0) development documentation.
44

55
Built with [Nextra](https://nextra.site/), a modern static site generation framework running on NextJS.
66

7+
> This project uses Nextra [version 2](https://nextra-v2-oe0zrpzjp-shud.vercel.app/).
8+
79
### Requirements
810

911
The following dependencies are used for this project. Feel free to experiment using other dependencies and versions.
@@ -20,7 +22,7 @@ The following dependencies are used for this project. Feel free to experiment us
2022
The app depends these libraries and frameworks.
2123

2224
- NextJS v14.2.5
23-
- Nextra v2.13.4
25+
- Nextra v2.13.4 [[v2]](https://nextra-v2-oe0zrpzjp-shud.vercel.app/)
2426
- nextra-theme-docs v2.13.4
2527
- React v18.3.1
2628
- TailwindCSS v3.4.7

docker-compose.dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
services:
2-
# NextJS v13 app running on development mode
2+
# NextJS v14 app running on development mode
33
acaptutorials.github.io-latest:
44
container_name: acaptutorials-docs-latest
55
image: acaptutorials/acaptutorials.github.io:latest

docs/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ RELEASE_PAGE=https://github.com/<GITHUB_REPOSITORY_ORG_OR_ACCOUNT>/<GITHUB_REPOS
33
COMMIT_ID=123456
44
OPENGRAPH_IMAGE_URL=https://<DOMAIN_URL>/banner.png
55
BASE_URL=https://localhost:3000
6-
# Uncomment these 2 CHOKIDAR lines if using Docker Desktop and WSL2 on Windows OS
6+
# Uncomment this line if using Docker Desktop and WSL2 on Windows OS
77
# WATCHPACK_POLLING=true

docs/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
FROM node:20.15.0-alpine as base
1+
FROM node:20.15.0-alpine AS base
22
RUN mkdir -p /opt/docs
33
WORKDIR /opt/docs
44
RUN adduser -S client
55
RUN chown -R client /opt/docs
66
COPY package*.json ./
77

88
# BUILD TARGET
9-
FROM base as build
9+
FROM base AS build
1010
RUN npm install && npm cache clean --force
1111
COPY . ./
1212
RUN npm run export
1313
USER client
1414

1515
# DEVELOPMENT CLIENT PROFILE
16-
FROM base as development
16+
FROM base AS development
1717
ENV NODE_ENV=development
1818
RUN npm install && npm cache clean --force
1919
COPY . ./
2020
EXPOSE 3000
2121
CMD ["npm", "run", "dev"]
2222

2323
# PRODUCTION CLIENT PROFILE
24-
FROM nginx:1.22.0-alpine as production
24+
FROM nginx:1.22.0-alpine AS production
2525
COPY --from=build /opt/docs/out /usr/share/nginx/html
2626
RUN rm /etc/nginx/conf.d/default.conf
2727
COPY config/nginx/nginx.conf /etc/nginx/conf.d

docs/pages/_meta.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
"type": "page",
2222
"newWindow": true
2323
},
24+
"announcements": {
25+
"title": "Announcements",
26+
"type": "page"
27+
},
2428
"video": {
2529
"title": "Video Tutorials",
2630
"type": "page"

docs/pages/about.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# About
1+
# About 💡
22

33
This site offers a more organized and structured approach to documenting the software development approaches for the Agro-Climatic Advisory Portal - Bicol (ACAP Bicol), initially released as ACAP 1.0 at the end of 2022 and now enhanced to version 2.0 as of 2024.

docs/pages/announcements.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Cards, Image } from 'nextra/components'
2+
3+
# Announcements 📣
4+
5+
<br />
6+
7+
<Cards num={1}>
8+
<Cards.Card arrow title="Firebase Storage Pricing Updates" href="/announcements/firebase-storage-2024">
9+
<>![Documentation theme](/assets/docs-theme.png)</>
10+
</Cards.Card>
11+
</Cards>

docs/pages/announcements/_meta.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"firebase-storage-2024": {
3+
"title": "Firebase Storage Pricing Plan Changes (2024)",
4+
"type": "page"
5+
}
6+
}
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
import { useEffect, useState, useMemo } from 'react'
2+
import { useTheme } from 'next-themes'
3+
import { Callout } from 'nextra/components'
4+
5+
export function FAQBox({ title, children, open = false }) {
6+
// Copied from /articles/provinces-municipalities.mdx
7+
const [isClient, setIsClient] = useState(false)
8+
const { theme, resolvedTheme } = useTheme()
9+
10+
useEffect(() => {
11+
setIsClient(true)
12+
}, [])
13+
14+
const detailsBgStyle = useMemo(() => {
15+
const bg = resolvedTheme === 'dark'
16+
? 'bg-neutral-800'
17+
: 'bg-neutral-50'
18+
19+
return `last-of-type:mb-0 rounded-lg ${bg} p-2 mt-4`
20+
}, [resolvedTheme])
21+
22+
return !isClient
23+
? <div>...</div>
24+
: (
25+
<details
26+
open={open}
27+
className={detailsBgStyle}
28+
>
29+
<summary>
30+
<strong className="text-md">{title}</strong>
31+
</summary>
32+
<div className="nx-p-2">{children}</div>
33+
</details>
34+
)
35+
}
36+
37+
# Firebase Storage Pricing Plan Updates (2024)
38+
39+
> _This article is a recap of the online meeting about changes to the Firebase Storage pricing plan held last October 14, 2024._
40+
41+
Firebase announced breaking changes regarding the no-cost pricing plan of their **Firebase Storage** service last September 2024. More information about this announcement is available in the [Cloud Storage Documentation for Firebase](https://firebase.google.cn/docs/storage/faqs-storage-changes-announced-sept-2024).
42+
43+
## FAQs
44+
45+
<FAQBox title="What is the Firebase Storage?">
46+
[Firebase Storage](https://firebase.google.com/docs/storage), also known as _Firebase Cloud Storage_, is an online cloud storage service provided by Google Firebase. It is one (1) of the four (4) major Firebase components used by ACAP aside from the **Firestore Database** <sup>[[1]](https://firebase.google.com/docs/firestore/)</sup>, **Firebase Authentication** <sup>[[3]](https://firebase.google.com/docs/auth/)</sup>, and **Firebase Hosting** <sup>[[4]](https://firebase.google.com/docs/hosting/)</sup>.
47+
48+
ACAP uses the Firebase Storage for:
49+
50+
- Hosting and uploading the generated PDF bulletin recommendations, allowing public PDF downloads in its PDF Bulletins Downloads page.
51+
- Hosting and storing several frontend picture assets and files or the Home page's GEOJSON map file (as an alternate option for using MapBox).
52+
</FAQBox>
53+
54+
<FAQBox title="Are there other Firebase components used by ACAP?">
55+
ACAP uses other Firebase components aside from the Firebase Storage. ACAP only uses the four (4) Firebase components among Firebase's [list of available](https://firebase.google.com/products-build) components/services:
56+
57+
- **Firestore** (Database) <sup>[[1]](https://firebase.google.com/docs/firestore/)</sup>
58+
- **Cloud Storage** (Firebase Storage) <sup>[[2]](https://firebase.google.com/docs/storage/)</sup>
59+
- **Authentication** (Email/Password) <sup>[[3]](https://firebase.google.com/docs/auth/)</sup>
60+
- **Hosting** <sup>[[4]](https://firebase.google.com/docs/hosting/)</sup>
61+
</FAQBox>
62+
63+
<FAQBox title="What are the notable changes (s) of this announcement?">
64+
- Firebase will discontinue providing the standard (no-cost) Spark plan for Firebase Storage starting <u><b>October 30, 2024</b></u>
65+
- More information about this announcement is available at https://firebase.google.cn/docs/storage/faqs-storage-changes-announced-sept-2024.
66+
</FAQBox>
67+
68+
<FAQBox title="How will changes to Firebase Storage affect ACAP?">
69+
70+
Starting on <span className="font-bold text-md text-green-600">October 30, 2024</span>:
71+
72+
- Initializing new Firebase Storage instances <u><b>will require a payment method</b></u>. It will require new Firebase projects subscribed to the Firebase pay-as-you-go Blaze plan by default.
73+
- Existing ACAP Firebase Storage, <u><b>created before October 30, 2024</b></u>, will continue to work <u><b>until October 2025</b></u>.
74+
- ACAP Firebase Storages not subscribed to the Firebase Blaze plan <u><b>after October 2025</b></u> will <u><b>cease to function</b></u> unless they subscribe to the Blaze plan.
75+
- <u><b>ACAP Video Tutorials</b></u> <sup>[[1]](https://youtu.be/gJESQaT0IBQ?si=fYA19J9OHiZR4V9X&t=127)</sup> regarding the Firebase Storage initialization will not work on Firebase projects subscribed to the standard (no-cost) Firebase plans
76+
77+
</FAQBox>
78+
79+
<FAQBox title="Will the other Firebase components used by ACAP be affected?">
80+
- No, this announcement only affects the <u>Firebase Storage</u>. Discontinued support of the Firebase standard (no-cost) pricing plan only affects the Firebase Storage.
81+
- Other Firebase components used by ACAP - the <u>Firestore Database</u>, <u>Firebase Authentication</u>, and <u>Firebase Hosting</u> still retain their standard (no-cost) pricing plans until further announcements or changes by Google Firebase.
82+
83+
<Callout>
84+
Subscribing to the Firebase Blaze Plan **will automatically enroll** all Firebase components to the pay-as-you-go Blaze plan, not just the Firebase Storage.
85+
</Callout>
86+
</FAQBox>
87+
88+
<FAQBox title="Where can I find the Firebase Pricing Plan?">
89+
The Firebase pricing plan is accessible at https://firebase.google.com/pricing.
90+
91+
<Callout>
92+
Subscribing to the Firebase Blaze Plan **will automatically enroll** all Firebase components to the pay-as-you-go Blaze plan, <u>including other Firebase components not used by ACAP</u>.
93+
94+
ACAP only uses the following Firebase components among Firebase's [list of available](https://firebase.google.com/products-build) components/services:
95+
96+
- **Firestore** (Database) <sup>[[1]](https://firebase.google.com/docs/firestore/)</sup>
97+
- **Cloud Storage** (Firebase Storage) <sup>[[2]](https://firebase.google.com/docs/storage/)</sup>
98+
- **Authentication** (Email/Password) <sup>[[3]](https://firebase.google.com/docs/auth/)</sup>
99+
- **Hosting** <sup>[[4]](https://firebase.google.com/docs/hosting/)</sup>
100+
101+
_All Firebase components service usage (including those not used by ACAP) will only reflect in the billing <u><b>upon activation</b></u> in the ACAP and <u><b>usage</b></u> beyond the no-cost Firebase plan._
102+
</Callout>
103+
</FAQBox>
104+
105+
<FAQBox title="What should I know about subscribing to the Firebase Blaze Plan?">
106+
107+
- Subscribing to the Firebase pay-as-you-go Blaze plan requires creating a Google Cloud billing account and electing credit card information for the Firebase project.
108+
- Billing subscriptions will only incur beyond standard (no-cost) usage/quotas of <u><b>activated</b></u> and <u><b>used</b></u> Firebase components/services <u>enabled by developers</u>. ACAP only expects usage from the **Firestore Database**, **Firebase Storage**, **Authentication**, and **Hosting** Firebase services.
109+
110+
<Callout>
111+
Refer to the Firebase Pricing table for more information about the standard (no-cost) billing and usage quotas at
112+
https://firebase.google.com/pricing
113+
</Callout>
114+
115+
- Firebase usage analytics are accessible at this URL with or without a subscription to the Firebase Blaze plan:
116+
117+
```text
118+
https://console.firebase.google.com/project/<YOUR_FIREBASE_PROJECT>/usage
119+
```
120+
121+
This page provides information for monitoring and providing insights, such as detailed pricing and usage of the active Firebase services used by the Firebase project.
122+
123+
<Callout type="warning">
124+
ACAP expects usage only from the following Firebase services: **Firestore Database**, **Firebase Storage**, **Authentication**, and **Hosting**. [ACAP's Security guidelines](/security) only cover these four (4) Firebase components, aside from general web application security practices and know-how, e.g., stressing the need for data validation <sup>[[1]](/security/#database) [[2]](/directories/server)</sup>.
125+
126+
> Developers can use other Firebase components as deemed necessary when needed. However, since they are not included originally in the ACAP project Firebase components, developers should care about using them responsibly to avoid incurring Security issues and unexpected billing.
127+
</Callout>
128+
</FAQBox>
129+
130+
<FAQBox title="Are there security considerations that I should be aware of?">
131+
132+
Ensuring **system integrity** and **strong security measures** is critical when handling:
133+
134+
1. Sensitive user information (e.g., full name and contact numbers)
135+
2. Paid subscription to external services (e.g., Firebase, Semaphore)
136+
3. Reliable and predictable information output
137+
138+
<Callout type="error">
139+
Before activating a paid Firebase subscription, consider whether unresolved [ACAP Security Technical Debts](/changelog#acap-2-security-debts) exist. If issues <sup>[[1]](https://github.com/amia-cis/acap-v2/issues/57) [[2]](https://github.com/amia-cis/acap-v2/issues/34)</sup> remain unaddressed, it may be beneficial to consult the lead ACAP programmer responsible for designing and implementing [ACAP 2.0](/changelog/#version-2-acap-20). Key topics to discuss include:
140+
141+
- How security concerns introduced in ACAP 2.0+ are being addressed
142+
- Plans for improving security and risk mitigation before enabling Firebase
143+
</Callout>
144+
145+
<Callout type="info">
146+
ACAP's [Security measures and practices for Firebase](/security) only cover the Firebase components that it actively uses: **Firestore Database**, **Firebase Storage**, **Authentication**, and **Hosting**.
147+
148+
Developers are encouraged to learn more about responsible Security measures and practices for other Firebase components or services, should they feel the need to use [other Firebase services](https://firebase.google.com/products-build) (e.g., **Firebase ML**, **Cloud Functions**, **Extensions**, etc) for their ACAPs other than **four (4) main Firebase components** used by ACAP.
149+
</Callout>
150+
</FAQBox>
151+
152+
## Firebase Storage Alternate Options
153+
154+
The meeting discussed the following alternate options for ACAP's Firebase Storage component, considering the discontinuation of its no-cost pricing plan.
155+
156+
1. Subscribe to the Firebase Blaze Plan
157+
2. Integrate a new standard plan (free-tier) Cloud Storage Provider to replace Firebase Storage
158+
3. Use the (Render) server file system for hosting PDFs

docs/pages/changelog.mdx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { useEffect, useState, useMemo } from 'react'
22
import { Callout, Steps } from 'nextra/components'
33
import { useTheme } from 'next-themes'
44

5+
import AnchorModal from '@/components/AnchorModal'
6+
57
export function FAQBoxError({ title, children, open = false }) {
68
const [isClient, setIsClient] = useState(false)
79
const { theme, resolvedTheme } = useTheme()
@@ -59,12 +61,20 @@ Version 2.0 and later versions may have new requirements that will thrive on new
5961
</Callout>
6062

6163
<FAQBoxError title="💀 Version 2.0 - 2.1 Security Technical Debts">
64+
<div id="acap-2-security-debts" />
6265
1. **Flexible Firestore Database Use:** Version 2.0+ adopted a more flexible approach for handling data management, facilitating faster feature development by performing _<u>WRITE operations to the database directly from the web front end</u>_ coupled with more _<u>lenient Firestore database Rules</u>_. However, this shift also introduced the potential for data to enter the database without the usual front-end controls through the [Firestore REST APIs](https://cloud.google.com/firestore/docs/reference/rest/). While this was not an issue in Version 1.0, it emerged as part of the effort to enhance development speed and feature delivery starting with Version 2.0.
6366
2. **Cross-Site Scripting (XSS) Vulnerability in Crop Recommendations:** Related to item 1, the new process for editing WYSIWYG HTML-form crop recommendations input may allow unsafe or inaccurate content due to limited validation through the [Firestore REST APIs](https://cloud.google.com/firestore/docs/reference/rest/). Risks associated with this were recognized early in the process, but the focus on delivering core features led to a delay in integrating security measures.
67+
<AnchorModal
68+
anchorText="XSS Vulnerability Awareness in ACAP 2.0"
69+
>
70+
A YouTube video detailing steps for exploiting XSS vulnerabilities in the **ACAP 2.0 crop recommendations** at https://www.youtube.com/watch?v=b9UZ6_OCTaY has been set to private permissions to limit exposure. This video is a resource for understanding the security challenges associated with these vulnerabilities and ACAP, which occurred starting on **version 2.0** due to new development approaches and priorities.
71+
72+
For ACAP Maintainers or developers interested in exploring the content, please contact the current active ACAP Maintainer(s) for an invitation to access the video. Engaging with this material can provide insights into the security considerations that have been acknowledged and inform future enhancements to the system's security measures.
73+
</AnchorModal>
6474
3. **Crop recommendations data integrity:** Ensuring that data presentations in PDF bulletins remain unaltered, trustworthy, and accurate is crucial for users and future developers. This priority stems from the concerns identified in items 1 and 2.
6575
4. **Firestore database pollution:** Also related to item 1, the new **"Support Services"** data with insufficient validation, if pushed through the [Firestore REST APIs](https://cloud.google.com/firestore/docs/reference/rest/), can potentially allow writing unlimited key-value pairs with unlimited text or Object content length in Firestore Documents or creating Collections/Documents recursively outside the developer's intended schema or structure. If left unchecked, this can speed up the consumption of the Firebase standard plan quota (or drive up the billing if subscribed to the Firebase Blaze plan) in the long run.
6676

67-
> These issues, raised during the early 2.0 development phase, have been communicated to the new main ACAP code Maintainer, who is also the new primary developer/programmer leading the creation and enhancement of new features for Version 2.0. The new code Maintainer has made thoughtful decisions for balancing development speed with feature delivery, reflecting their understanding of the project's scope and the perceived security needs. They are open to addressing these issues as time and priorities allow within the ACAP project timeline.
77+
> These issues, raised during the early 2.0 development phase (June 2024), have been communicated to the new main ACAP code Maintainer, who is also the new primary developer/programmer leading the creation and enhancement of new features for Version 2.0. The new code Maintainer has made thoughtful decisions for balancing development speed with feature delivery, reflecting their understanding of the project's scope and the perceived security needs. They are open to addressing these issues as time and priorities allow within the ACAP project timeline.
6878
</FAQBoxError>
6979
7080
<br />

docs/pages/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Callout } from 'nextra/components'
22

3-
# Welcome to ACAP Tutorials
3+
# Welcome to ACAP Tutorials 🏡
44

55
This site offers a more organized and structured approach to documenting the software development approaches for the Agro-Climatic Advisory Portal - Bicol (ACAP Bicol), initially released as [ACAP 1.0](/changelog/#version-1-acap-10) at the end of 2022 and now enhanced to version [2.0](https://acap-bicol.github.io/) as of 2024.
66

0 commit comments

Comments
 (0)