From 9e278676eb8f2ca132056211ca358be9d0395241 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sun, 25 Feb 2024 22:32:43 +0000 Subject: [PATCH] Dockerizes website, adds license (MIT), sample .env, docs (README.txt) and updates .gitignore to iforget build assets --- .github/README.md | 30 +++++++++++++++++------------- web/.env.sample | 23 +++++++++++++++++++++++ web/.gitignore | 16 ++++++++-------- web/Dockerfile | 32 ++++++++++++++++++++++++++++++++ web/LICENSE | 21 +++++++++++++++++++++ web/README.txt | 30 ++++++++++++++++-------------- 6 files changed, 117 insertions(+), 35 deletions(-) create mode 100644 web/.env.sample create mode 100644 web/Dockerfile create mode 100644 web/LICENSE diff --git a/.github/README.md b/.github/README.md index 8f8931f..ad85b4c 100644 --- a/.github/README.md +++ b/.github/README.md @@ -1,8 +1,6 @@

-

🌐 awesome-privacy.xyz

- -*

A curated list of privacy & security-focused apps, software, and providers 🔐

* +

A curated list of privacy & security-focused apps, software, and providers 🔐

[⏬ Skip to Content ⏬](#password-managers) @@ -12,12 +10,13 @@ Large data-hungry corporations dominate the digital world but with little, or no Migrating to open-source applications with a strong emphasis on privacy and security will help stop corporations, governments, and hackers from logging, storing or selling your personal data. -**Note**: Remember that [no software is perfect](#important-considerations), and it is important to follow good [security practices](https://github.com/Lissy93/personal-security-checklist/blob/HEAD/CHECKLIST.md). - -A Codeberg mirror is available [here](https://codeberg.org/alicia/awesome-privacy). +**Note**: Remember that [no software is perfect](#important-considerations), and it is important to follow good [security practices](https://github.com/Lissy93/personal-security-checklist/blob/HEAD/CHECKLIST.md)
+**Mirror**: This repo is mirrored to [https://codeberg.org/alicia/awesome-privacy](https://codeberg.org/alicia/awesome-privacy)
+**Repo Admin**: [Website Docs](#the-website) | [Contributing](#contributing) | [Acknowledgment](#acknowledgements) | [License](#license) -## Contents +
+

Contents

- **Essentials** - [Password Managers](#password-managers) (5) @@ -115,6 +114,8 @@ A Codeberg mirror is available [here](https://codeberg.org/alicia/awesome-privac - [Screenshot Tools](#screenshot-tools) (0) - [3D Graphics](#3d-graphics) (0) - [Animation](#animation) (0) +
+ ## Essentials ### Password Managers @@ -3127,7 +3128,8 @@ Then run the following commands to fetch the code, install dependencies and star ```shell git clone git@github.com:Lissy93/awesome-privacy.git cd awesome-privacy/web -yarn +cp .env.sample .env +yarn install yarn dev # Then open 127.0.0.1:4321 in your browser ``` @@ -3534,7 +3536,9 @@ This project exists thanks to all the people who've helped build and maintain it ## License -> _**[Lissy93/Awesome-Privacy](https://github.com/Lissy93/awesome-privacy)** is licensed under [MIT](https://github.com/Lissy93/awesome-privacy/blob/HEAD/LICENSE) © [Alicia Sykes](https://aliciasykes.com) 2024._
+> _**[Lissy93/Awesome-Privacy/web](https://github.com/Lissy93/awesome-privacy/tree/main/web)** is licensed under [MIT](https://gist.github.com/Lissy93/143d2ee01ccc5c052a17)_
+> _**[awesome-privacy.yml](https://github.com/Lissy93/awesome-privacy/blob/main/awesome-privacy.yml)** is licensed under [CC0-1.0 license](https://github.com/Lissy93/awesome-privacy/blob/HEAD/LICENSE)_
+> _Copyright © Alicia Sykes <[aliciasykes.com](https://aliciasykes.com)> 2024._
> For information, see TLDR Legal > MIT
@@ -3564,13 +3568,13 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-

© Alicia Sykes 2024
- Licensed under MIT
-
- Thanks for visiting :) + Licensed under MIT & + CC0-1.0
+ +
Thanks for visiting :)

diff --git a/web/.env.sample b/web/.env.sample new file mode 100644 index 0000000..51c29f5 --- /dev/null +++ b/web/.env.sample @@ -0,0 +1,23 @@ +# Copy this file to web/.env and complete the values +# Once completed, DO NOT commit this file to source control! +# Need help? Check the GitHub: https://github.com/lissy93/awesome-privacy + +# The target deployment platform (can be vercel, netlify, cloudflare, node) +# Use to determine appropriate Astro adapter at build-time +DEPLOY_TARGET=''; + +# The build output method (can be 'server' or 'hybrid') +# To set weather content is pre-rendered or rendered on-demand +OUTPUT='' + +# The fully qualified domain name for your site +# Used to generate sitemap.xml and for canonical URLs +SITE_URL='' + +# GitHub API key (with pub repo read perms). +# This is used to fetch reposity stats for open source apps which are listed +GITHUB_API_KEY='' + +# A Font Awesome Pro package token +# This is used in order to install Font Awesome and fetch pro icons +FONTAWESOME_PACKAGE_TOKEN='' diff --git a/web/.gitignore b/web/.gitignore index 6d4c0aa..b8a4815 100644 --- a/web/.gitignore +++ b/web/.gitignore @@ -1,21 +1,21 @@ -# build output -dist/ - -# generated types -.astro/ - # dependencies node_modules/ -# logs +# Install + buuld logs npm-debug.log* yarn-debug.log* yarn-error.log* pnpm-debug.log* +# build output +dist/ + +# generated types +.astro/ +.vercel/ # environment variables .env .env.production -# macOS-specific files +# macOS crap .DS_Store diff --git a/web/Dockerfile b/web/Dockerfile new file mode 100644 index 0000000..030da28 --- /dev/null +++ b/web/Dockerfile @@ -0,0 +1,32 @@ +############################################################################### +# A lightweight, non-root, multi-stage, cross-architecture Dockerfile # +# That you can use in order to easily deploy Awesome Privacy to any server # +# For docs visit the GitHub repo: https://github.com/lissy93/awesome-privacy # +# Licensed under MIT (C) Alicia Sykes 2024 # +############################################################################### +# Usage: # +# Step 1: Build the Docker image # +# docker build -t awesome-privacy . # +# # +# Step 2: Run the Docker container # +# docker run -p 8080:80 awesome-privacy # +# # +# Step 3: Access the running app # +# Open your browser and navigate to http://127.0.0.1:8080 # +############################################################################### + +# Stage 1: Build the app (Alpine + Node.js) +# Copies manifest and src files from host, installs deps, and builds the app +FROM node:16-alpine as build +WORKDIR /app +COPY package.json yarn.lock .env* ./ +RUN yarn install --frozen-lockfile +COPY . . +RUN yarn build + +# Stage 2: Serve the app (Alpine + NGINX) +# Copies dist from the previous stage, exposes port 80, and starts web server +FROM nginx:alpine as runtime +COPY --from=build /app/dist /usr/share/nginx/html +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] diff --git a/web/LICENSE b/web/LICENSE new file mode 100644 index 0000000..bee7ddc --- /dev/null +++ b/web/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Alicia Sykes + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/web/README.txt b/web/README.txt index f8532de..838f7ab 100644 --- a/web/README.txt +++ b/web/README.txt @@ -11,16 +11,18 @@ DEVELOPMENT SETUP To get started, you'll need Node and Git installed. Then run the following commands: -# 1. Clone the repo -git clone git@github.com:Lissy93/awesome-privacy.git -# 2. Navigate into it -cd awesome-privacy/web -# 3. Install dependencies -yarn install -# 4. Start the development server -yarn dev -5. Open browser -open http://127.0.0.1:4321 +1. Clone the repo + git clone git@github.com:Lissy93/awesome-privacy.git +2. Navigate into it + cd awesome-privacy/web +3. Add secrets to .env + mv .env.sample .env +4. Install dependencies + yarn install +5. Start the development server + yarn dev +Open browser + open http://127.0.0.1:4321 ================================================================================ @@ -36,12 +38,12 @@ Option 3) Use the included Dockerfile to build and run the application on any se TECHNOLOGY ---------- The website is built with Astro, and statically generated at build-time. -This means that changes to the data will not be reflected until the site is rebuilt. +This means that changes to the raw data will not be reflected until the site is rebuilt. Dynamic elems (search + comments) are built as Svelte islands, and rehydrated at runtime. Most the code is written in Typescript. We're not using a CSS library, just plain SASS. -The site also uses: -- Fuse.js for fuzzy search +The site also uses these dependencies: +- fuse.js for fuzzy search - js-yaml for parsing YAML - marked for markdown rendering - fontawesome for iconography @@ -58,7 +60,7 @@ If you only wish to update content, there's no need to edit the site's source co SITE STRUCTURE -------------- -All views are located in /src/pages. +All views are located in /src/pages The general site structure is as follows: /