Skip to content

Commit

Permalink
chore(client): move the client to its own subfolder
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellacosse committed Mar 13, 2024
1 parent 3bf9d6d commit 896396c
Show file tree
Hide file tree
Showing 617 changed files with 3,039 additions and 2,784 deletions.
46 changes: 23 additions & 23 deletions .github/workflows/build_and_test_debug_client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
web_test:
name: Web Test
runs-on: ubuntu-20.04
timeout-minutes: 10
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/[email protected]
Expand All @@ -37,20 +37,20 @@ jobs:
run: npm run action lint

- name: Build Web App
run: npm run action www/build
run: npm run action client/src/www/build

- name: Test Web App
run: npm run action www/test
run: npm run action client/src/www/test

- uses: codecov/codecov-action@v3
with:
files: ./output/coverage/www/coverage-final.json
files: ./client/src/output/coverage/www/coverage-final.json
flags: unittests, www

linux_debug_build:
name: Linux Debug Build
runs-on: ubuntu-20.04
timeout-minutes: 10
timeout-minutes: 20
needs: web_test
steps:
- name: Checkout
Expand All @@ -72,12 +72,12 @@ jobs:
go-version-file: '${{ github.workspace }}/go.mod'

- name: Build Linux Client
run: npm run action electron/build linux
run: npm run action client/src/electron/build linux

windows_debug_build:
name: Windows Debug Build
runs-on: windows-2019
timeout-minutes: 10
timeout-minutes: 20
needs: web_test
steps:
- name: Support longpaths
Expand All @@ -102,7 +102,7 @@ jobs:
go-version-file: '${{ github.workspace }}/go.mod'

- name: Build Windows Client
run: npm run action electron/build windows
run: npm run action client/src/electron/build windows

macos_debug_build:
name: MacOS Debug Build
Expand Down Expand Up @@ -132,18 +132,18 @@ jobs:
go-version-file: '${{ github.workspace }}/go.mod'

- name: Build Tun2Socks (required for Test OutlineAppleLib)
run: npm run action tun2socks/build macos
run: npm run action client/src/tun2socks/build macos

- name: Test OutlineAppleLib
run: npm run action cordova/test macos
run: npm run action client/src/cordova/test macos

- name: Build MacOS Client
run: npm run action cordova/build macos
run: npm run action client/src/cordova/build macos

- uses: codecov/codecov-action@v3
with:
xcode: true
xcode_archive_path: ./output/coverage/apple/macos/TestResult.xcresult
xcode_archive_path: ./client/src/output/coverage/apple/macos/TestResult.xcresult
flags: unittests, apple, macos

ios_debug_build:
Expand Down Expand Up @@ -174,18 +174,18 @@ jobs:
go-version-file: '${{ github.workspace }}/go.mod'

- name: Build Tun2Socks (required for Test OutlineAppleLib)
run: npm run action tun2socks/build ios
run: npm run action client/src/tun2socks/build ios

- name: Test OutlineAppleLib
run: npm run action cordova/test ios
run: npm run action client/src/cordova/test ios

- name: Build iOS Client
run: npm run action cordova/build ios
run: npm run action client/src/cordova/build ios

- uses: codecov/codecov-action@v3
with:
xcode: true
xcode_archive_path: ./output/coverage/apple/ios/TestResult.xcresult
xcode_archive_path: ./client/src/output/coverage/apple/ios/TestResult.xcresult
flags: unittests, apple, ios

maccatalyst_debug_build:
Expand Down Expand Up @@ -216,24 +216,24 @@ jobs:
go-version-file: '${{ github.workspace }}/go.mod'

- name: Build Tun2Socks (required for Test OutlineAppleLib)
run: npm run action tun2socks/build maccatalyst
run: npm run action client/src/tun2socks/build maccatalyst

- name: Test OutlineAppleLib
run: npm run action cordova/test maccatalyst
run: npm run action client/src/cordova/test maccatalyst

- name: Build Mac Catalyst Client
run: npm run action cordova/build maccatalyst
run: npm run action client/src/cordova/build maccatalyst

- uses: codecov/codecov-action@v3
with:
xcode: true
xcode_archive_path: ./output/coverage/apple/maccatalyst/TestResult.xcresult
xcode_archive_path: ./client/src/output/coverage/apple/maccatalyst/TestResult.xcresult
flags: unittests, apple, maccatalyst

android_debug_build:
name: Android Debug Build
runs-on: ubuntu-20.04
timeout-minutes: 10
timeout-minutes: 20
needs: web_test
steps:
- name: Checkout
Expand All @@ -260,7 +260,7 @@ jobs:
java-version: 11

- name: Setup Android
run: bash ./tools/build/setup_linux_android.sh
run: bash ./client/tools/build/setup_linux_android.sh

- name: Build Android Client
run: npm run action cordova/build android -- --verbose
run: npm run action client/src/cordova/build android -- --verbose
44 changes: 0 additions & 44 deletions .github/workflows/pull_request_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,47 +82,3 @@ jobs:
run: |
echo "This PR has the 'need test' label. Please remove it before merging."
exit 1
translations:
name: '[WIP] Missing Translations Label'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3

- name: Check resources/original_messages.json
id: changed-original-messages
uses: tj-actions/changed-files@v35
with:
files: resources/original_messages.json

- name: Collect src/www/messages Changes
if: steps.changed-original-messages.outputs.any_changed == 'true'
id: changed-translated-messages
uses: tj-actions/changed-files@v35
with:
files: src/www/messages/*.json

- name: Check src/www/messages Changes
if: steps.changed-original-messages.outputs.any_changed == 'true'
id: not-every-translation-changed
run: |
TRANSLATIONS_COUNT="$(ls src/www/messages | wc -l | xargs)"
IFS=' ' read -r -a TRANSLATED_MESSAGES <<< "${{ steps.changed-translated-messages.outputs.all_changed_files }}"
TRANSLATED_MESSAGES_COUNT="${#TRANSLATED_MESSAGES[@]}"
if [ "${TRANSLATED_MESSAGES_COUNT}" != "${TRANSLATIONS_COUNT}" ]; then
echo "Translations are not atomic. Please update all translations in a single commit."
echo "Changed translations: ${TRANSLATED_MESSAGES_COUNT}"
echo "Expected translations: ${TRANSLATIONS_COUNT}"
echo "result=true" >> "${GITHUB_OUTPUT}"
fi
- name: Apply 'Missing Translations' Label
if: steps.not-every-translation-changed.outputs.result == 'true'
uses: actions-ecosystem/action-add-labels@v1
with:
labels: missing translations
25 changes: 3 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,31 +1,12 @@
node_modules
.idea
.vs/
.vscode
*.DS_Store
*.env
*.pdb
*.sw?
/node_modules
/server_manager/node_modules
/server_manager/do_install_script.ts
/server_manager/gcp_install_script.ts
/build
/server_manager/install_scripts/do_install_script.ts
/server_manager/install_scripts/gcp_install_script.ts
/output
/platforms
/plugins
/third_party/Potatso/Pods
/www
coverage
info.txt
keystore.p12
obj/
Outline.apk
Outline.apks
packages/
toc.pb
tools/OutlineService/OutlineService/bin/*
tools/smartdnsblock/bin/*
!tools/OutlineService/OutlineService/bin/*.exe
!tools/smartdnsblock/bin/*.exe
universal.apk
xcuserdata/
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
BUILDDIR=$(CURDIR)/output/build
GOBIN=$(CURDIR)/output/bin
BUILDDIR=$(CURDIR)/client/output/build
GOBIN=$(CURDIR)/client/output/bin

GOMOBILE=$(GOBIN)/gomobile
# Add GOBIN to $PATH so `gomobile` can find `gobind`.
GOBIND=env PATH="$(GOBIN):$(PATH)" "$(GOMOBILE)" bind
IMPORT_HOST=github.com
IMPORT_PATH=$(IMPORT_HOST)/Jigsaw-Code/outline-client
IMPORT_PATH=$(IMPORT_HOST)/Jigsaw-Code/outline-apps

.PHONY: android apple linux windows

all: android apple linux windows

ROOT_PKG=src/tun2socks
ROOT_PKG=client/src/tun2socks
# Don't strip Android debug symbols so we can upload them to crash reporting tools.
ANDROID_BUILD_CMD=$(GOBIND) -a -ldflags '-w' -target=android -androidapi 19 -tags android -work

Expand All @@ -23,7 +23,7 @@ $(BUILDDIR)/android/tun2socks.aar: $(GOMOBILE)

$(BUILDDIR)/ios/Tun2socks.xcframework: $(GOMOBILE)
# -iosversion should match what outline-client supports.
$(GOBIND) -iosversion=11.0 -target=ios,iossimulator -o $@ -ldflags '-w' -bundleid org.outline.tun2socks $(IMPORT_PATH)/$(ROOT_PKG)/outline/tun2socks $(IMPORT_PATH)/$(ROOT_PKG)/outline/shadowsocks
$(GOBIND) -iosversion=12.0 -target=ios,iossimulator -o $@ -ldflags '-w' -bundleid org.outline.tun2socks $(IMPORT_PATH)/$(ROOT_PKG)/outline/tun2socks $(IMPORT_PATH)/$(ROOT_PKG)/outline/shadowsocks

$(BUILDDIR)/macos/Tun2socks.xcframework: $(GOMOBILE)
# MACOSX_DEPLOYMENT_TARGET and -iosversion should match what outline-client supports.
Expand Down
90 changes: 9 additions & 81 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,92 +1,20 @@
# Outline Client
# Outline Apps

![Build and Test](https://github.com/Jigsaw-Code/outline-client/actions/workflows/build_and_test_debug_client.yml/badge.svg?branch=master) [![Mattermost](https://badgen.net/badge/Mattermost/Outline%20Community/blue)](https://community.internetfreedomfestival.org/community/channels/outline-community) [![Reddit](https://badgen.net/badge/Reddit/r%2Foutlinevpn/orange)](https://www.reddit.com/r/outlinevpn/)
[![Mattermost](https://badgen.net/badge/Mattermost/Outline%20Community/blue)](https://community.internetfreedomfestival.org/community/channels/outline-community) [![Reddit](https://badgen.net/badge/Reddit/r%2Foutlinevpn/orange)](https://www.reddit.com/r/outlinevpn/)

> **Test coverage currently only tracks the Apple Libraries and core web view code:**
>
> [![codecov](https://codecov.io/gh/Jigsaw-Code/outline-client/branch/master/graph/badge.svg?token=gasD8v5tjn)](https://codecov.io/gh/Jigsaw-Code/outline-client)
## Access to the free and open internet!

The Outline Client is a cross-platform VPN or proxy client for Windows, macOS, iOS, Android, and ChromeOS. The Outline Client is designed for use with the [Outline Server](https://github.com/Jigsaw-Code/outline-server) software, but it is fully compatible with any [Shadowsocks](https://shadowsocks.org/) server.
Outline makes it easy to create a VPN server, giving anyone access to the free and open internet.

The client's user interface is implemented in [Polymer](https://www.polymer-project.org/) 2.0. Platform support is provided by [Cordova](https://cordova.apache.org/) and [Electron](https://electronjs.org/), with additional native components in this repository.
We have two core apps: [Ouline Manager](./server_manager) and [Ouline Client](./client).

To join our Outline Community, [sign up for the IFF Mattermost](https://internetfreedomfestival.org/wiki/index.php/IFF_Mattermost).
### Outline Manager

## Requirements for all builds
The Outline Manager is a graphical user interface for managing Outline servers. It is available for Windows, macOS, and Linux.

All builds require [Node](https://nodejs.org/) 18 (lts/hydrogen), and [Go](https://golang.org/) 1.20 installed in addition to other per-platform requirements.
### Outline Client

> 💡 NOTE: if you have `nvm` installed, run `nvm use` to switch to the correct node version!
After cloning this repo, install all node dependencies:

```sh
npm install
```

## Building the shared web app

Outline clients share the same web app across all platforms. This code is located in the src/www directory. If you are making changes to the shared web app and do not need to test platform-specific functionality, you can test in a desktop browser by running:

```sh
npm run action src/www/start
```

The latter command will open a browser instance running the app. Browser platform development will use fake servers to test successful and unsuccessful connections.

The app logic is located in [src/www/app](src/www/app). UI components are located in [src/www/ui_components](src/www/ui_components). If you want to work specifically on an individual UI element, try the storybook!:

```sh
npm run action src/www/storybook
```

> 💡 NOTE: the `src` part of the path is optional. `npm run action www/start` resolves to the same script.
> 💡 NOTE: every script in this repository can be run with `npm run action` -
> for a CLI-like experience, add something like
>
> ```sh
> alias outline="npm run action"
> ```
>
> _(you can call it whatever you like)_
>
> to your shell, then try `outline www/start`!
## Passing configuration flags to actions
Certain actions take configuration flags - but since we're running them through `npm`, you'll have to use the `--` seperator to funnel them through to the underlying process. For example, to set up a MacOS project in release mode, you'd run:
```sh
SENTRY_DSN=<your sentry dsn> npm run action cordova/setup macos -- --buildMode=release --versionName=<your version name>
```
## Life of a Packet
[How does the Outline Client work?](docs/life_of_a_packet.md)
## Accepting a server invite
[Looking for instructions on how to accept a server invite?](docs/invitation_instructions.md)
## Platform-specific development
Each platform is handled differently:
1. [Developing for Apple **(MacOS and iOS)**](src/cordova/apple)
2. [Developing for **Android**](src/cordova/android)
3. [Developing for Electron **(Windows and Linux)**](src/electron)
## Error reporting
To enable error reporting through [Sentry](https://sentry.io/) for local builds, run:
```bash
export SENTRY_DSN=[Sentry development API key]
[platform-specific build command]
```
Release builds on CI are configured with a production Sentry API key.
The Outline Client is a cross-platform proxy client for Windows, macOS, iOS, Android, and Linux. The Outline Client is designed for use with the server deployed with the Outline Manager, but it is also fully compatible with any [Shadowsocks](https://shadowsocks.org/) server.

## Support

Expand Down
File renamed without changes.
19 changes: 19 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/node_modules
/build
/output
/platforms
/plugins
/third_party/Potatso/Pods
/www
coverage
info.txt
keystore.p12
obj/
Outline.apk
Outline.apks
packages/
toc.pb
tools/smartdnsblock/bin/*
!tools/smartdnsblock/bin/*.exe
universal.apk
xcuserdata/
File renamed without changes.
Loading

0 comments on commit 896396c

Please sign in to comment.