Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into sort_blocked_list
Browse files Browse the repository at this point in the history
  • Loading branch information
ismailbazookka committed Oct 10, 2023
2 parents 5cdb42d + 0eb3187 commit dd3c65d
Show file tree
Hide file tree
Showing 550 changed files with 15,895 additions and 11,348 deletions.
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@
.gitignore
.prettierignore
.vscode/

node_modules
*.md
dist

android/
ios/
67 changes: 67 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build Apps and Create Release

on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"

jobs:
build_ios:
runs-on: ubuntu-latest

steps:
- name: Build iOS on Appflow
uses: ionic-team/appflow-build@v1
with:
token: ${{ secrets.APPFLOW_TOKEN }}
app-id: 9f0851ec
platform: iOS
build-type: app-store
certificate: Distribution
destinations: Voyager App Store
filename: iOS-${{ github.ref_name }}-${{ github.run_id }}
upload-artifact: iOS-Build.zip

build_android:
runs-on: ubuntu-latest

steps:
- name: Build Android on Appflow
uses: ionic-team/appflow-build@v1
with:
token: ${{ secrets.APPFLOW_TOKEN }}
app-id: 9f0851ec
platform: Android
build-type: release
certificate: Voyager Play Store
destinations: Voyager Play Store
filename: Android-${{ github.ref_name }}-${{ github.run_id }}
upload-artifact: Android-Build.zip

create_release:
needs: [build_ios, build_android]
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Download iOS Artifact
uses: actions/download-artifact@v3
with:
name: iOS-Build.zip
path: artifacts/ios

- name: Download Android Artifact
uses: actions/download-artifact@v3
with:
name: Android-Build.zip
path: artifacts/android

- name: Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: |
artifacts/ios/*
artifacts/android/*
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
- name: 📦 Install dependencies
run: pnpm install --frozen-lockfile

# - name: 🧪 Test project
# run: pnpm test
- name: 🧪 Test project
run: pnpm test

- name: 📝 Lint
run: pnpm lint
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ yarn-error.log*

# Optional eslint cache
.eslintcache

vite.config.ts.timestamp-*
5 changes: 4 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
dist/
pnpm-lock.yaml
pnpm-lock.yaml
ios/
android/
vite.config.ts.timestamp-*
5 changes: 5 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"hooks": {
"before:bump": "npx capacitor-set-version -v ${version} -b $BUILD"
}
}
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ FROM docker.io/library/node:lts-alpine AS base
# Prepare work directory
WORKDIR /voyager

ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"

# enable corepack & set network-timeout
RUN corepack enable &&\
pnpm config set network-timeout 300000
Expand All @@ -17,7 +20,7 @@ RUN apk add --no-cache git

# Prepare build deps ( ignore postinstall scripts for now )
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile --ignore-scripts
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile --ignore-scripts

# Copy all source files
COPY . ./
Expand All @@ -33,12 +36,12 @@ ARG UID=911 GID=911

COPY package.json pnpm-lock.yaml server.mjs ./

RUN pnpm install --prod --frozen-lockfile --ignore-scripts
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile --ignore-scripts

# Create a dedicated user and group
RUN set -eux; \
addgroup -g "${GID}" voyager; \
adduser -u "${UID}" -D -G voyager voyager
addgroup -g "${GID}" voyager; \
adduser -u "${UID}" -D -G voyager voyager

USER voyager

Expand Down
110 changes: 93 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<p align="center">
<a href="https://vger.app" target="_blank" rel="noopener noreferrer">
<img width="160" height="160" src="./public/logo_minified.svg" alt="Voyager logo">
<img width="160" height="160" src="./public/logo-minified.svg" alt="Voyager logo">
</a>
</p>

<h1 align="center"/>Voyager <sup><em>alpha</em></sup></h1>
<h1 align="center"/>Voyager</h1>

<p align="center">
A mobile-first Lemmy web client
</p>

<p align="center">
(formerly wefwef)
&nbsp;<a href="https://vger.app"><img src="public/badges/pwa.svg" height="45"></a>&nbsp;&#8203;&nbsp;
<a href="https://apps.apple.com/us/app/voyager-for-lemmy/id6451429762"><img src="public/badges/ios.svg" height="45"></a>&nbsp;&nbsp;
<a href="https://play.google.com/store/apps/details?id=app.vger.voyager"><img src="public/badges/play.svg" height="45"></a>&nbsp;
</p>

<br/>
<p align="center">
<a href="https://matrix.to/#/#vger.app:matrix.org"><img src="https://img.shields.io/badge/chat-matrix-blue?style=flat&logo=matrix" alt="matrix chat"></a>
</p>
Expand All @@ -26,9 +26,9 @@ A mobile-first Lemmy web client
</a>
</p>

## ⚠️ Voyager is in Alpha
## Voyager for Lemmy

Voyager is an [Apollo-like](https://apolloapp.io/) open source web client for [Lemmy](https://join-lemmy.org/). It's a mobile-first app, but works great on desktop devices, too. Please feel free to try it out, but be aware you will likely encounter bugs and missing functionality.
Voyager is an [Apollo-like](https://apolloapp.io/) open source web client for [Lemmy](https://join-lemmy.org/). It's a mobile-first app, but works great on desktop devices, too. Please feel free to try it out!

**What does Voyager currently support?**

Expand All @@ -53,6 +53,8 @@ Voyager is an [Apollo-like](https://apolloapp.io/) open source web client for [L

- More customization
- Native notifications and badging
- Mod features
- Native apps
- Translations
- ...and more!

Expand All @@ -72,36 +74,51 @@ The Voyager team maintains a deployment at:

- 🐭 Production: [vger.app](https://vger.app)

### Self-Host Docker Deployment

In order to host Voyager yourself you can use the provided Dockerfile to build a container with Voyager. The Docker container itself does not provide any SSL/TLS handling. You'll have to add this bit yourself.
One could put Voyager behind popular reverse proxies with SSL Handling like Traefik, NGINX etc.
### Self-Host

> **Tip:** Use [Watchtower](https://github.com/containrrr/watchtower) to keep your deployment automatically up to date!
There are two ways you can run Voyager as a PWA in a production environment. The recommended method is using **docker**. We also support a **traditional** deployment method without docker. Read below to see how to get each method set up.

#### Environment variables

- `CUSTOM_LEMMY_SERVERS` (optional) e.g. `lemmy.world,lemmy.ml,sh.itjust.works` - a comma separated list of suggested servers. The first will be used as default view for logged out users. You can specify only one if you want.

#### From source
#### Docker Deployment

In order to host Voyager yourself you can use the provided Dockerfile to build a container with Voyager. The Docker container itself does not provide any SSL/TLS handling. You'll have to add this bit yourself.
One could put Voyager behind popular reverse proxies with SSL Handling like Traefik, NGINX etc.

> **Tip:** Use [Watchtower](https://github.com/containrrr/watchtower) to keep your deployment automatically up to date!
##### From source

1. checkout source `git clone https://github.com/aeharding/voyager.git`
1. go into new source dir: `cd voyager`
1. build Docker image: `docker build . -t voyager`
1. start container: `docker run --init --rm -it -p 5314:5314 voyager`

#### Prebuilt
##### Prebuilt

1. pull image `docker pull ghcr.io/aeharding/voyager:latest`
1. start container: `docker run --init --rm -it -p 5314:5314 voyager`

Note: The provided Dockerfile creates a container which will eventually run Voyager as non-root user.

#### Traditional Deployment

If you want to run a production build without Docker, you can build from source and run with the following commands (change `PORT` to whatever you prefer):

```sh
pnpm install
pnpm build
NODE_ENV=production PORT=5106 node server.mjs
```

### Ecosystem

- 🇫🇮 [m.lemmy.world](https://m.lemmy.world) - Voyager hosted by the mastodon.world team. [Contact/privacy](https://mastodon.world/about)
- 🇸🇬 [v.opnxng.com](https://v.opnxng.com) - Voyager hosted by Opnxng in Singapore. [Contact/privacy](https://about.opnxng.com)
- 🇲🇽 [voyager.nohost.network](https://voyager.nohost.network) - Voyager hosted by Nohost in Mexico. [Contact/privacy](https://nohost.network)
- 🇺🇸 [vger.thesanewriter.com](https://vger.thesanewriter.com) - Voyager hosted by the lemmy.thesanewriter.com team. [Contact/privacy](https://lemmy.thesanewriter.com/legal)

> **Note**: Community deployments are **NOT** maintained by the Voyager team. They may not be synced with Voyager's source code. Please do your own research about the host servers before using them.
Expand All @@ -115,9 +132,7 @@ We would also appreciate sponsoring other contributors to Voyager. If someone he

## 🧑‍💻 Contributing

We're really excited that you're interested in contributing to Voyager!

> **NOTE** Voyager is receiving a lot of new users and interest in contributing. Before contributing, [please read this](https://github.com/aeharding/voyager/discussions/180). 🙂
We're really excited that you're interested in contributing to Voyager! Before contributing, make sure you read through existing issues. Before working on a large PR, please open an issue to discuss first.

### Local Setup

Expand All @@ -130,6 +145,47 @@ pnpm run dev

`Warning`: you will need `corepack` enabled.

### iOS Native App

To build the iOS native app:

1. Install [Node](https://nodejs.org/en)
2. Install [Ionic CLI](https://ionicframework.com/docs/cli)
3. Install [Xcode](https://developer.apple.com/xcode/)
4. [Cocoapods](https://cocoapods.org/)

Then, build the project and copy web dependencies over:

```sh
corepack enable
pnpm install
ionic capacitor build ios
```

Finally, can run the project with `CMD+R`.

### Android Native App

To build the Android native app:

1. Install [Node](https://nodejs.org/en)
2. Install [Ionic CLI](https://ionicframework.com/docs/cli)
3. Install [Android Studio](https://developer.android.com/studio)

In Voyager source code directory:

```sh
corepack enable
pnpm install
ionic capacitor build android
```

Android Studio should open.

You may need to sync. `File -> Sync Project with Gradle Files`

Finally, can run the project with `Ctrl+R`.

### Testing

Voyager uses [Vitest](https://vitest.dev). You can run the test suite with:
Expand All @@ -138,6 +194,18 @@ Voyager uses [Vitest](https://vitest.dev). You can run the test suite with:
pnpm test
```

### 🚀 Releasing

To release a new version:

```sh
BUILD=123; npx release-it
```

Make sure the build number is incremental. This is used for F-droid.

Voyager uses [Ionic App Flow](https://ionic.io/appflow) for Apple App Store and Android Play Store builds. Unfortunately, there's no way to provide public access to build logs and artifacts. Hopefully someday. :-)

## 📲 PWA

Voyager works best added to the homescreen. There are certain features that only work there, like badging and smooth page transitions.
Expand All @@ -152,10 +220,18 @@ Voyager works best added to the homescreen. There are certain features that only

## 👨‍💻 Contributors

Shoutout to [@fer0n](https://github.com/fer0n) for the great logo and splashscreen! And thank you 💙 all of our contributors to the codebase:

<a href="https://github.com/aeharding/voyager/graphs/contributors">
<img src="https://contrib.rocks/image?repo=aeharding/voyager" />
</a>

## 📄 License

### Logo & Splashscreen

CC BY-SA 4.0 &copy; [@fer0n](https://github.com/fer0n)

### Code

[AGPL-3.0](./LICENSE) &copy; Voyager contributors
Loading

0 comments on commit dd3c65d

Please sign in to comment.