Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Ubuntu is an open source software operating system that runs from the desktop, t

The site is largely maintained by the [Web and Design team](https://ubuntu.com/blog/topics/design) at [Canonical](https://www.canonical.com). It is a simple, database-less, informational website project based on [Flask](https://flask.palletsprojects.com/en/1.1.x/) and hosted on a [Charmed Kubernetes](https://ubuntu.com/kubernetes) cluster.

You can read more about the application's architecture [in ARCHITECTURE.md](ARCHITECTURE.md).
You can read more about the application's architecture [in ARCHITECTURE.md](./docs/ARCHITECTURE.md).

## Bugs and issues

Expand All @@ -33,7 +33,7 @@ PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true

Once the server has started, you can visit <http://127.0.0.1:8001> in your browser.

For more information on how to work with ubuntu.com project please refer to [HACKING.md](HACKING.md).
For more information on how to work with ubuntu.com project please refer to [HACKING.md](./docs/HACKING.md).

# Deploy

Expand All @@ -43,4 +43,4 @@ You can find the deployment config in the deploy folder.

The content of this project is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/), and the underlying code used to format and display that content is licensed under the [LGPLv3](https://opensource.org/license/lgpl-3-0/) by [Canonical Ltd](http://www.canonical.com/).

With ♥ from Canonical
With ♥ from Canonical
46 changes: 40 additions & 6 deletions ARCHITECTURE.md → docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,41 @@ Merging a pull request (PR) into the `main` branch will automatically trigger a

## File structure

- [`./redirects.yaml`](rerdirects.yaml): A file defining URL paths for 302 redirects
📁 Project Structure – `ubuntu.com`

```
ubuntu.com/
├── redirects.yaml # Defines 302 redirects for legacy paths
├── deleted.yaml # Defines 410 responses for deleted content
├── releases.yaml # Defines Ubuntu releases shown on the website
├── appliances.yaml # Appliance metadata for ubuntu.com/appliance
├── navigation.yaml # Main navigation structure
├── secondary-navigation.yaml # Secondary nav for product-specific paths
├── entrypoint # Startup command for Gunicorn (used in Docker)
├── Dockerfile # Docker image setup for production (via Jenkins)
├── requirements.txt # Python package dependencies
├── konf/
│ └── site.yaml # Kubernetes deployment config (via Konf)
├── scripts/ # Developer utility scripts (non-prod)
├── templates/ # Jinja2 templates for page rendering
├── webapp/ # Python Flask application
│ ├── app.py # Main app entry point and route registration
│ ├── views.py # View functions mapped to URL routes
│ ├── login.py # Login/authentication logic
│ ├── macaroons.py # Macaroons-based authentication
│ ├── certified/ # Blueprint: /certified routes
│ ├── shop/ # Blueprint: /shop routes
│ └── security/ # Blueprint: /security routes
└── README.md # Project overview and contribution guide
```

- [`./redirects.yaml`](redirects.yaml): A file defining URL paths for 302 redirects
- [`./deleted.yaml`](deleted.yaml): A file defining URL paths for 310 deleted responses
- [`./entrypoint`](entrypoint): The commands for running the application with Gunicorn. This is used within `Dockerfile` for running the production site.
- [`./Dockerfile`](Dockerfile): Used by the [production Jenkins job](https://jenkins.canonical.com/webteam/job/ubuntu.com) for building the production docker image. See [our standard deployment flow](https://discourse.canonical.com/t/how-the-standard-website-deployment-flow-is-set-up-in-github-jenkins-and-kubernetes/2112).
Expand All @@ -29,10 +63,10 @@ Merging a pull request (PR) into the `main` branch will automatically trigger a
- [`./appliances.yaml`](appliances.yaml): Appliance metadata for displaying on ubuntu.com/appliance
- [`./requirements.txt`](requirements.txt): Python dependencies for the project
- [`./webapp/`](webapp/): The Python application files:
- [`app.py`](webapp/app.py) is entrypoint for the parent application, and defines URL routes
- [`views.py`](webapp/views.py) contains the view functions for handing routed URL paths
- [`certified/`](webapp/certified/), [`shop/`](webapp/shop/) and [`security/`](webapp/security/) contain blueprints for the sub-paths of ubuntu.com
- [`login.py`](webapp/login.py) and [`macaroons.py`](webapp/macaroons.py) contain the logic for authentication and login
- [`app.py`](webapp/app.py) is entrypoint for the parent application, and defines URL routes
- [`views.py`](webapp/views.py) contains the view functions for handing routed URL paths
- [`certified/`](webapp/certified/), [`shop/`](webapp/shop/) and [`security/`](webapp/security/) contain blueprints for the sub-paths of ubuntu.com
- [`login.py`](webapp/login.py) and [`macaroons.py`](webapp/macaroons.py) contain the logic for authentication and login
- [`./templates/`](templates/): Jinja2 templates, used by the Flask app for serving HTTP pages
- [`./konf/site.yaml`](konf/site.yaml): Kubernetes configuration files to be interpreted by [Konf](https://github.com/canonical/konf), our custom config manager. Used in our [standard deployment flow](https://discourse.canonical.com/t/how-the-standard-website-deployment-flow-is-set-up-in-github-jenkins-and-kubernetes/2112) to release the site to Kubernetes.
- [`./scripts/`](scripts/): Local utility scripts, not used by the production application
Expand Down Expand Up @@ -104,4 +138,4 @@ The API, even though it's hosted on ubuntu.com at ubuntu.com/security/cves.json

### Pro

**To be completed** by @jpmartinspt.
**To be completed** by @jpmartinspt.
File renamed without changes.
File renamed without changes.
Loading