Skip to content

Commit

Permalink
shotgun approach
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellacosse committed Apr 17, 2024
1 parent aaedd5a commit 3e42a72
Show file tree
Hide file tree
Showing 33 changed files with 91 additions and 91 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/build_and_test_debug_client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ jobs:
run: npm run action lint

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

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

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

linux_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 client/src/tun2socks/build macos
run: npm run action client/tun2socks/build macos

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

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

- uses: codecov/codecov-action@v3
with:
xcode: true
xcode_archive_path: ./client/src/output/coverage/apple/macos/TestResult.xcresult
xcode_archive_path: ./client/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 client/src/tun2socks/build ios
run: npm run action client/tun2socks/build ios

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

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

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

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

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

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

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

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

android_debug_build:
Expand Down Expand Up @@ -263,4 +263,4 @@ jobs:
run: bash ./client/tools/build/setup_linux_android.sh

- name: Build Android Client
run: npm run action client/src/cordova/build android -- --verbose
run: npm run action client/cordova/build android -- --verbose
2 changes: 1 addition & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set: [pipefail]
run: when_changed

includes:
client:tun2socks: ./client/src/tun2socks/Taskfile.yml
client:tun2socks: ./client/tun2socks/Taskfile.yml

tasks:
clean:
Expand Down
6 changes: 3 additions & 3 deletions client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ npm install
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 client/src/www/start
npm run action client/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 client/src/www/storybook
npm run action client/www/storybook
```

> [!NOTE]
Expand All @@ -55,7 +55,7 @@ npm run action client/src/www/storybook
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 client/src/cordova/setup macos -- --buildMode=release --versionName=<your version name>
SENTRY_DSN=<your sentry dsn> npm run action client/cordova/setup macos -- --buildMode=release --versionName=<your version name>
```
## Life of a Packet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@
EB87FDF31871DA8E0020F90C /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; name = www; path = ../../www; sourceTree = "<group>"; };
EB87FDF41871DAF40020F90C /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = ../../config.xml; sourceTree = "<group>"; };
ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bridging-Header.h"; sourceTree = "<group>"; };
F63DC2162970AFE600D92E0A /* OutlineAppleLib */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = OutlineAppleLib; path = ../../src/cordova/apple/OutlineAppleLib; sourceTree = "<group>"; };
F63DC2162970AFE600D92E0A /* OutlineAppleLib */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = OutlineAppleLib; path = ..//cordova/apple/OutlineAppleLib; sourceTree = "<group>"; };
F840E1F0165FE0F500CFE078 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = Outline/config.xml; sourceTree = "<group>"; };
FC55AB411F4F960A0056F12C /* VpnExtension-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "VpnExtension-Info.plist"; path = "Outline/VpnExtension-Info.plist"; sourceTree = SOURCE_ROOT; };
FC8C310A1FAA814A004262BE /* NetworkExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetworkExtension.framework; path = System/Library/Frameworks/NetworkExtension.framework; sourceTree = SDKROOT; };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
70DAA8D91908785C00AF3749 /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; path = www; sourceTree = "<group>"; };
A508014170A1492DB0D800B3 /* Outline-Bridging-Header.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; path = "Outline-Bridging-Header.h"; sourceTree = "<group>"; };
AA09EA80E0C54DFFB24A1810 /* OutlinePlugin.swift */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = OutlinePlugin.swift; path = "cordova-plugin-outline/OutlinePlugin.swift"; sourceTree = "<group>"; };
F63DC21E2970B23B00D92E0A /* OutlineAppleLib */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = OutlineAppleLib; path = ../../src/cordova/apple/OutlineAppleLib; sourceTree = "<group>"; };
F63DC21E2970B23B00D92E0A /* OutlineAppleLib */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = OutlineAppleLib; path = ..//cordova/apple/OutlineAppleLib; sourceTree = "<group>"; };
FC0799E62037532900A1C822 /* OutlineLauncher.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OutlineLauncher.app; sourceTree = BUILT_PRODUCTS_DIR; };
FC0799E82037532A00A1C822 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
FC0799EF2037532A00A1C822 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
Expand Down
18 changes: 9 additions & 9 deletions client/cordova/build.action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import fs from 'node:fs/promises';
import cordovaLib from 'cordova-lib';
const {cordova} = cordovaLib;

import {runAction} from '../../src/build/run_action.mjs';
import {getRootDir} from '../../src/build/get_root_dir.mjs';
import {spawnStream} from '../../src/build/spawn_stream.mjs';
import {downloadHttpsFile} from '../../src/build/download_file.mjs';
import {runAction} from '..//src/build/run_action.mjs';
import {getRootDir} from '..//src/build/get_root_dir.mjs';
import {spawnStream} from '..//src/build/spawn_stream.mjs';
import {downloadHttpsFile} from '..//src/build/download_file.mjs';

import {getBuildParameters} from '../build/get_build_parameters.mjs';

Expand All @@ -34,9 +34,9 @@ import {getBuildParameters} from '../build/get_build_parameters.mjs';
export async function main(...parameters) {
const {platform, buildMode, verbose} = getBuildParameters(parameters);

await runAction('client/src/www/build', ...parameters);
await runAction('client/src/tun2socks/build', ...parameters);
await runAction('client/src/cordova/setup', ...parameters);
await runAction('client/www/build', ...parameters);
await runAction('client/tun2socks/build', ...parameters);
await runAction('client/cordova/setup', ...parameters);

if (verbose) {
cordova.on('verbose', message => console.debug(`[cordova:verbose] ${message}`));
Expand Down Expand Up @@ -132,7 +132,7 @@ async function androidDebug(verbose) {
argv: [
// Path is relative to /platforms/android/.
// See https://docs.gradle.org/current/userguide/composite_builds.html#command_line_composite
'--gradleArg=--include-build=../../src/cordova/android/OutlineAndroidLib',
'--gradleArg=--include-build=..//cordova/android/OutlineAndroidLib',
verbose ? '--gradleArg=--info' : '--gradleArg=--quiet',
],
},
Expand All @@ -156,7 +156,7 @@ async function androidRelease(ksPassword, ksContents, javaPath, verbose) {
argv: [
// Path is relative to /platforms/android/.
// See https://docs.gradle.org/current/userguide/composite_builds.html#command_line_composite
'--gradleArg=--include-build=../../src/cordova/android/OutlineAndroidLib',
'--gradleArg=--include-build=..//cordova/android/OutlineAndroidLib',
verbose ? '--gradleArg=--info' : '--gradleArg=--quiet',
`--keystore=${keystorePath}`,
'--alias=privatekey',
Expand Down
2 changes: 1 addition & 1 deletion client/cordova/import_messages.action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import chalk from 'chalk';
import minimist from 'minimist';
import path from 'path';
import url from 'url';
import {getRootDir} from '../../../src/build/get_root_dir.mjs';
import {getRootDir} from '../..//src/build/get_root_dir.mjs';
import {readFile, readdir, mkdir} from 'fs/promises';
import * as ANDROID_IMPORTER from './android/import_messages.mjs';
import * as IOS_IMPORTER from './apple/import_messages.mjs';
Expand Down
10 changes: 5 additions & 5 deletions client/cordova/setup.action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import replace from 'replace-in-file';
import cordovaLib from 'cordova-lib';
const {cordova} = cordovaLib;

import {getRootDir} from '../../../src/build/get_root_dir.mjs';
import {runAction} from '../../../src/build/run_action.mjs';
import {spawnStream} from '../../../src/build/spawn_stream.mjs';
import {getRootDir} from '../..//src/build/get_root_dir.mjs';
import {runAction} from '../..//src/build/run_action.mjs';
import {spawnStream} from '../..//src/build/spawn_stream.mjs';
import {getBuildParameters} from '../build/get_build_parameters.mjs';
import chalk from 'chalk';

Expand All @@ -39,8 +39,8 @@ const WORKING_CORDOVA_OSX_COMMIT = '07e62a53aa6a8a828fd988bc9e884c38c3495a67';
export async function main(...parameters) {
const {platform, buildMode, verbose, buildNumber, versionName} = getBuildParameters(parameters);

await runAction('client/src/www/build', ...parameters);
await runAction('client/src/tun2socks/build', ...parameters);
await runAction('client/www/build', ...parameters);
await runAction('client/tun2socks/build', ...parameters);

await rmfr(path.resolve(getRootDir(), 'platforms'));
await rmfr(path.resolve(getRootDir(), 'plugins'));
Expand Down
4 changes: 2 additions & 2 deletions client/cordova/test.action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import path from 'path';
import fs from 'fs/promises';
import rmfr from 'rmfr';

import {getRootDir} from '../../../src/build/get_root_dir.mjs';
import {spawnStream} from '../../../src/build/spawn_stream.mjs';
import {getRootDir} from '../..//src/build/get_root_dir.mjs';
import {spawnStream} from '../..//src/build/spawn_stream.mjs';

const APPLE_ROOT = path.join(getRootDir(), 'client', 'src', 'cordova', 'apple');
const APPLE_LIBRARY_NAME = 'OutlineAppleLib';
Expand Down
6 changes: 3 additions & 3 deletions client/electron/build.action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import minimist from 'minimist';
import {runAction} from '../build/run_action.mjs';
import {getBuildParameters} from '../../client/src/build/get_build_parameters.mjs';
import {getBuildParameters} from '../../client/build/get_build_parameters.mjs';
import electron, {Platform} from 'electron-builder';
import copydir from 'copy-dir';
import fs from 'fs/promises';
Expand Down Expand Up @@ -48,8 +48,8 @@ export async function main(...parameters) {
);
}

await runAction('client/src/www/build', ...parameters);
await runAction('client/src/tun2socks/build', ...parameters);
await runAction('client/www/build', ...parameters);
await runAction('client/tun2socks/build', ...parameters);
await runAction('src/electron/build_main', ...parameters);

await copydir.sync(
Expand Down
8 changes: 4 additions & 4 deletions client/electron/build_main.action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
// limitations under the License.

import {runAction} from '../build/run_action.mjs';
import {getBuildParameters} from '../../client/src/build/get_build_parameters.mjs';
import {getWebpackBuildMode} from '../../client/src/build/get_webpack_build_mode.mjs';
import {runWebpack} from '../../client/src/build/run_webpack.mjs';
import {getBuildParameters} from '../../client/build/get_build_parameters.mjs';
import {getWebpackBuildMode} from '../../client/build/get_webpack_build_mode.mjs';
import {runWebpack} from '../../client/build/run_webpack.mjs';
import electronMainWebpackConfigs from './webpack_electron_main.mjs';
import fs from 'fs/promises';
import path from 'path';
Expand All @@ -36,7 +36,7 @@ export async function main(...parameters) {
);
}

await runAction('client/src/www/build', ...parameters);
await runAction('client/www/build', ...parameters);

// TODO(daniellacosse): separate building the preload script out into its own separate step
await runWebpack(
Expand Down
4 changes: 2 additions & 2 deletions client/electron/connectivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import * as dns from 'dns';

import {timeoutPromise} from '../../client/src/infrastructure/timeout_promise';
import * as errors from '../../client/src/www/model/errors';
import {timeoutPromise} from '../../client/infrastructure/timeout_promise';
import * as errors from '../../client/www/model/errors';

const DNS_LOOKUP_TIMEOUT_MS = 10000;

Expand Down
8 changes: 4 additions & 4 deletions client/electron/go_vpn_tunnel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
import {powerMonitor} from 'electron';
import {platform} from 'os';

import {pathToEmbeddedBinary} from '../../client/src/infrastructure/electron/app_paths';
import {ShadowsocksSessionConfig} from '../../client/src/www/app/tunnel';
import {TunnelStatus} from '../../client/src/www/app/tunnel';
import {ErrorCode, fromErrorCode, UnexpectedPluginError} from '../../client/src/www/model/errors';
import {pathToEmbeddedBinary} from '../../client/infrastructure/electron/app_paths';
import {ShadowsocksSessionConfig} from '../../client/www/app/tunnel';
import {TunnelStatus} from '../../client/www/app/tunnel';
import {ErrorCode, fromErrorCode, UnexpectedPluginError} from '../../client/www/model/errors';

import {ChildProcessHelper, ProcessTerminatedExitCodeError, ProcessTerminatedSignalError} from './process';
import {RoutingDaemon} from './routing_service';
Expand Down
6 changes: 3 additions & 3 deletions client/electron/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import * as process from 'process';
import * as url from 'url';
import autoLaunch = require('auto-launch'); // tslint:disable-line

import * as errors from '../../client/src/www/model/errors';
import * as errors from '../../client/www/model/errors';

import {ShadowsocksSessionConfig} from '../../client/src/www/app/tunnel';
import {TunnelStatus} from '../../client/src/www/app/tunnel';
import {ShadowsocksSessionConfig} from '../../client/www/app/tunnel';
import {TunnelStatus} from '../../client/www/app/tunnel';
import {GoVpnTunnel} from './go_vpn_tunnel';
import {installRoutingServices, RoutingDaemon} from './routing_service';
import {TunnelStore, SerializableTunnel} from './tunnel_store';
Expand Down
6 changes: 3 additions & 3 deletions client/electron/routing_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import {platform, userInfo} from 'os';
import * as path from 'path';
import * as sudo from 'sudo-prompt';

import {getAppPath} from '../../client/src/infrastructure/electron/app_paths';
import {TunnelStatus} from '../../client/src/www/app/tunnel';
import {ErrorCode, SystemConfigurationException} from '../../client/src/www/model/errors';
import {getAppPath} from '../../client/infrastructure/electron/app_paths';
import {TunnelStatus} from '../../client/www/app/tunnel';
import {ErrorCode, SystemConfigurationException} from '../../client/www/model/errors';

const isLinux = platform() === 'linux';
const isWindows = platform() === 'win32';
Expand Down
8 changes: 4 additions & 4 deletions client/electron/start.action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
import url from 'url';
import electron from 'electron';

import {runAction} from '../../client/src/build/run_action.mjs';
import {getBuildParameters} from '../../client/src/build/get_build_parameters.mjs';
import {getRootDir} from '../../client/src/build/get_root_dir.mjs';
import {spawnStream} from '../../client/src/build/spawn_stream.mjs';
import {runAction} from '../../client/build/run_action.mjs';
import {getBuildParameters} from '../../client/build/get_build_parameters.mjs';
import {getRootDir} from '../../client/build/get_root_dir.mjs';
import {spawnStream} from '../../client/build/spawn_stream.mjs';

/**
* @description Builds and starts the electron application.
Expand Down
2 changes: 1 addition & 1 deletion client/electron/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../client/src/www/tsconfig.json",
"extends": "../../client/www/tsconfig.json",
"compilerOptions": {
"outDir": "../../build/electron"
}
Expand Down
2 changes: 1 addition & 1 deletion client/electron/tunnel_store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import * as fs from 'fs';
import * as path from 'path';

import {ShadowsocksSessionConfig} from '../../client/src/www/app/tunnel';
import {ShadowsocksSessionConfig} from '../../client/www/app/tunnel';

// Format to store a tunnel configuration.
export interface SerializableTunnel {
Expand Down
2 changes: 1 addition & 1 deletion client/electron/vpn_tunnel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import {TunnelStatus} from '../../client/src/www/app/tunnel';
import {TunnelStatus} from '../../client/www/app/tunnel';

// Represents a VPN tunnel to a proxy server.
export interface VpnTunnel {
Expand Down
2 changes: 1 addition & 1 deletion client/tun2socks/build.action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

import url from 'url';
import {spawnStream} from '../../../src/build/spawn_stream.mjs';
import {spawnStream} from '../..//src/build/spawn_stream.mjs';
import {getBuildParameters} from '../build/get_build_parameters.mjs';

/**
Expand Down
4 changes: 2 additions & 2 deletions client/tun2socks/outline/connectivity/connectivity.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"net/http"
"time"

"github.com/Jigsaw-Code/outline-apps/client/src/tun2socks/outline"
"github.com/Jigsaw-Code/outline-apps/client/src/tun2socks/outline/neterrors"
"github.com/Jigsaw-Code/outline-apps/client/tun2socks/outline"
"github.com/Jigsaw-Code/outline-apps/client/tun2socks/outline/neterrors"
"github.com/Jigsaw-Code/outline-sdk/transport"
)

Expand Down
Loading

0 comments on commit 3e42a72

Please sign in to comment.