diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..aed4370 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @daniellacosse diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..3b76de7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,37 @@ +name: Report Unexpected Behavior +type: Bug +description: File a bug report. +body: + - type: checkboxes + id: existing-issues-check + attributes: + label: "Confirm: Verified Existing Issues" + description: "Before proceeding, confirm you've searched for similar issues." + options: + - label: "I have searched the [existing issues](https://github.com/Jigsaw-Code/outline-app-maker/issues) and found no similar bug reports." + required: true + + - type: textarea + id: reproduction-steps + attributes: + label: "Steps to Reproduce" + description: "List the precise steps needed to reproduce the bug, starting from a fresh state where possible." + placeholder: | + 1. Go to '...' or run 'docker run ...' + 2. Perform '....' + 3. Observe '....' + + - type: textarea + id: expected-behavior + attributes: + label: "Expected Behavior" + description: "What did you expect to happen in this case?" + + - type: input + id: environment + attributes: + label: "Environment" + description: "Please specify your relevant system details: stuff like operating system, Docker version, and the commit you're using." + placeholder: "e.g., OS: Sequoia 16.7, etc." + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..89bb0f7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,4 @@ +contact_links: + - name: Reddit + url: https://www.reddit.com/r/outlinevpn/ + about: Ask questions and discuss with the community. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..fb71264 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,21 @@ +name: Feature Request +type: Feature +description: Request a new feature! +body: + - type: checkboxes + id: existing-features-check + attributes: + label: "Confirm: Verified Existing Feature Requests" + description: "Before proceeding, confirm you've searched for similar feature requests. If a similar request exists, please add your thoughts there instead of opening a new one." + options: + - label: "I have searched the [existing issues](https://github.com/Jigsaw-Code/outline-app-maker/issues) and found no similar feature requests." + required: true + + - type: textarea + id: feature-description + attributes: + label: "Feature Description" + description: "Please describe the feature in detail. What use case does it address, and why is the current system insufficient?" + placeholder: "e.g. I would like to be able to..." + validations: + required: true diff --git a/.github/workflows/quality_checks.yml b/.github/workflows/quality_checks.yml new file mode 100644 index 0000000..17c828d --- /dev/null +++ b/.github/workflows/quality_checks.yml @@ -0,0 +1,82 @@ +name: Quality Checks + +on: + pull_request: + types: [opened,synchronize] + +permissions: + contents: read + +jobs: + build_android_project: + name: Build Android Project + runs-on: ubuntu-latest + + steps: + - name: Clone Repository + uses: actions/checkout@v4 + + - name: Install Node + uses: actions/setup-node@v3 + with: + node-version-file: .nvmrc + cache: npm + cache-dependency-path: ./package-lock.json + + - name: Install NPM Dependencies + run: npm ci + + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + + - name: Generate Android Project + run: npm run build -- --platform=android --entryUrl="https://www.example.com" + + build_ios_project: + name: Build iOS Project + runs-on: macos-latest + + steps: + - name: Clone Repository + uses: actions/checkout@v4 + + - name: Install Node + uses: actions/setup-node@v3 + with: + node-version-file: .nvmrc + cache: npm + cache-dependency-path: ./package-lock.json + + - name: Install NPM Dependencies + run: npm ci + + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + + - name: Generate iOS Project + run: npm run build -- --platform=ios --entryUrl="https://www.example.com" + + licensing: + name: License Headers + runs-on: ubuntu-latest + + steps: + - name: Clone Repository + uses: actions/checkout@v4 + + - name: Check Files + run: | + REQUIRED_HEADER_SNIPPET="Copyright 20[0-9][0-9] The Outline Authors" + MISSING_HEADER_FILES=$(find . \( -name "*.handlebars" -o -name "*.mjs" -o -name "*.html" -o -name "*.sh" \) -not -name "*.json.handlebars" -not -name "*.md.handlebars" -exec grep -L "${REQUIRED_HEADER_SNIPPET}" {} +) + + if [[ -n "$MISSING_HEADER_FILES" ]]; then + echo "Error: The following files are missing the required license header:" + echo "$MISSING_HEADER_FILES" + exit 1 + else + echo "All files have the required license header." + fi diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..84ea456 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "yaml.schemas": { + "https://www.schemastore.org/github-issue-config.json": "./.github/ISSUE_TEMPLATE/config.yml" + } +} diff --git a/README.md b/README.md index ff8d91b..6d4dab5 100644 --- a/README.md +++ b/README.md @@ -8,31 +8,32 @@ To verify that your system has the necessary dependencies to generate your web w ./doctor ``` -## Building the app project for **iOS** +## Building the app project for **Android** -> [!WARNING] -> You can only build iOS apps on MacOS. -> Currently only works with build targets of iOS 17.2 (and below?) +> [!NOTE] +> If you want to build Android on Windows, please use [Windows Subsystem for Linux (WSL)](https://learn.microsoft.com/en-us/windows/wsl/install) -* You will need the url you want to load initially in your app. -* You will need [go](https://golang.org/) to build the SDK library. -* You will need [Node.js](https://nodejs.org/en/) for the project setup and web server. -* You will need [XCode](https://developer.apple.com/xcode/). -* You will need [cocoapods](https://cocoapods.org/). +* You will need: + * the url you want to load initially in your app. + * [Node.js](https://nodejs.org/en/) for the project setup and web server. + * [go](https://golang.org/) to build the SDK library. + * [JDK 17](https://stackoverflow.com/a/70649641) to build the app. + * [Android Studio](https://developer.android.com/studio/). + * Make sure to [install the NDK](https://developer.android.com/studio/projects/install-ndk#default-version). + * Make sure to [set the correct JDK](https://stackoverflow.com/a/30631386). -[Please refer to CapacitorJS's environment setup guide](https://capacitorjs.com/docs/getting-started/environment-setup#ios-requirements) and run `./doctor` to check to see if you have all the required dependencies. +[Please refer to CapacitorJS's environment setup guide](https://capacitorjs.com/docs/getting-started/environment-setup#android-requirements) and run `./doctor` to check to see if you have all the required dependencies. ```sh npm run reset -npm run build -- --platform=ios --entryUrl="https://www.example.com" -npm run open:ios +npm run build -- --platform=android --entryUrl="https://www.example.com" ``` -Click the "play" button in XCode to start your iOS app! +Wait for Gradle to load your project. Click the "play" button in Android Studio to start your Android app! [See below for the list of available configuration options.](#available-configuration-options) -### Adding icon and splash screen assets to your generated iOS project +### Adding icon and splash screen assets to your generated Android project > [!NOTE] > TODO: automate this process @@ -43,42 +44,42 @@ You'll need to add the following images to the `assets` folder in your generated - A 2732x2732 png titled `splash.png` containing your splash screen. - Another 2732x2732 png titled `splash-dark.png` containing your splash screen in dark mode. -Then, run the following command to generate and place the assets in the appropriate places in your iOS project: +Then, run the following command to generate and place the assets in the appropriate places in your Android project: ```sh -npx capacitor-assets generate --ios +npx capacitor-assets generate --android ``` -### Publishing your app in the App Store +### Publishing your app in the Google Play Store -[Follow these instructions on how to publish your app for beta testing and the App Store.](https://developer.apple.com/documentation/xcode/distributing-your-app-for-beta-testing-and-releases) +[Follow these instructions to learn how to publish your app to the Google Play Store](https://developer.android.com/studio/publish) -## Building the app project for **Android** -> [!WARNING] -> If you want to build Android on Windows, please use [Windows Subsystem for Linux (WSL)](https://learn.microsoft.com/en-us/windows/wsl/install) +## Building the app project for **iOS** -* You will need the url you want to load initially in your app. -* You will need [Node.js](https://nodejs.org/en/) for the project setup and web server. -* You will need [go](https://golang.org/) to build the SDK library. -* You will need [JDK 17](https://stackoverflow.com/a/70649641) to build the app. -* You will need [Android Studio](https://developer.android.com/studio/). - * Make sure to [install the NDK](https://developer.android.com/studio/projects/install-ndk#default-version). - * Make sure to [set the correct JDK](https://stackoverflow.com/a/30631386). +> [!NOTE] +> You can only build iOS apps on MacOS. +> Currently only works with build targets of iOS 17.2 (and below?) -[Please refer to CapacitorJS's environment setup guide](https://capacitorjs.com/docs/getting-started/environment-setup#android-requirements) and run `./doctor` to check to see if you have all the required dependencies. +* You will need: + * The url you want to load initially in your app. + * [go](https://golang.org/) to build the SDK library. + * [Node.js](https://nodejs.org/en/) for the project setup and web server. + * [XCode](https://developer.apple.com/xcode/). + * [cocoapods](https://cocoapods.org/). + +[Please refer to CapacitorJS's environment setup guide](https://capacitorjs.com/docs/getting-started/environment-setup#ios-requirements) and run `./doctor` to check to see if you have all the required dependencies. ```sh npm run reset -npm run build -- --platform=android --entryUrl="https://www.example.com" -npm run open:android +npm run build -- --platform=ios --entryUrl="https://www.example.com" ``` -Wait for Gradle to load your project. Click the "play" button in Android Studio to start your Android app! +Click the "play" button in XCode to start your iOS app! [See below for the list of available configuration options.](#available-configuration-options) -### Adding icon and splash screen assets to your generated Android project +### Adding icon and splash screen assets to your generated iOS project > [!NOTE] > TODO: automate this process @@ -89,17 +90,17 @@ You'll need to add the following images to the `assets` folder in your generated - A 2732x2732 png titled `splash.png` containing your splash screen. - Another 2732x2732 png titled `splash-dark.png` containing your splash screen in dark mode. -Then, run the following command to generate and place the assets in the appropriate places in your Android project: +Then, run the following command to generate and place the assets in the appropriate places in your iOS project: ```sh -npx capacitor-assets generate --android +npx capacitor-assets generate --ios ``` -### Publishing your app in the Google Play Store +### Publishing your app in the App Store -[Follow these instructions to learn how to publish your app to the Google Play Store](https://developer.android.com/studio/publish) +[Follow these instructions on how to publish your app for beta testing and the App Store.](https://developer.apple.com/documentation/xcode/distributing-your-app-for-beta-testing-and-releases) -## Available Configuration Options +## Available Configuration Options for `npm run build` | Option | Description | Possible Values | | ------------------- | ------------------------------------------------------------------------------- | ------------------------ | @@ -124,7 +125,7 @@ npm run start:navigator -- --entryUrl="https://www.example.com" \ Once the server has started, you can then run the build commands above in a separate terminal to view the demo in your app. -## Available Configuration Options +### Available Configuration Options for `npm run start:navigator` | Option | Description | Possible Values | | ------------------- | ------------------------------------------------------------------------------- | ------------------------ | @@ -142,9 +143,3 @@ When encountering an issue, the first thing you'll want to do is run the doctor ``` Additionally, you should run `npm run reset` to ensure your `output` and `node_modules` folders have not been tampered with! - -### Commonly occuring issues - -> [!NOTE] -> TODO: compile a list of commonly occuring issues. - diff --git a/wrapper_app_project/.scripts/config.mjs b/wrapper_app_project/.scripts/config.mjs index 4ed18e8..43811f4 100644 --- a/wrapper_app_project/.scripts/config.mjs +++ b/wrapper_app_project/.scripts/config.mjs @@ -1,3 +1,16 @@ +// Copyright 2025 The Outline Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. import { promises as fs } from 'node:fs' import path from 'node:path' diff --git a/wrapper_app_project/.scripts/util.mjs b/wrapper_app_project/.scripts/util.mjs index 6b4c368..8309ed4 100644 --- a/wrapper_app_project/.scripts/util.mjs +++ b/wrapper_app_project/.scripts/util.mjs @@ -1,3 +1,16 @@ +// Copyright 2025 The Outline Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. import fs from 'node:fs' import archiver from 'archiver' diff --git a/wrapper_app_project/template/android/app/build.gradle.handlebars b/wrapper_app_project/template/android/app/build.gradle.handlebars index a446565..21f7b1a 100644 --- a/wrapper_app_project/template/android/app/build.gradle.handlebars +++ b/wrapper_app_project/template/android/app/build.gradle.handlebars @@ -1,3 +1,17 @@ +// Copyright 2025 The Outline Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + apply plugin: 'com.android.application' android { diff --git a/wrapper_app_project/template/android/app/src/main/java/org/getoutline/pwa/Config.kt.handlebars b/wrapper_app_project/template/android/app/src/main/java/org/getoutline/pwa/Config.kt.handlebars index 16f30e4..6a2c28a 100644 --- a/wrapper_app_project/template/android/app/src/main/java/org/getoutline/pwa/Config.kt.handlebars +++ b/wrapper_app_project/template/android/app/src/main/java/org/getoutline/pwa/Config.kt.handlebars @@ -1,3 +1,17 @@ +// Copyright 2025 The Outline Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package {{appId}} object Config { diff --git a/wrapper_app_project/template/android/app/src/main/java/org/getoutline/pwa/MainActivity.kt.handlebars b/wrapper_app_project/template/android/app/src/main/java/org/getoutline/pwa/MainActivity.kt.handlebars index ac626aa..c474c22 100644 --- a/wrapper_app_project/template/android/app/src/main/java/org/getoutline/pwa/MainActivity.kt.handlebars +++ b/wrapper_app_project/template/android/app/src/main/java/org/getoutline/pwa/MainActivity.kt.handlebars @@ -1,3 +1,17 @@ +// Copyright 2025 The Outline Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package {{appId}} import android.os.Bundle diff --git a/wrapper_app_project/template/android/app/src/main/res/values/strings.xml.handlebars b/wrapper_app_project/template/android/app/src/main/res/values/strings.xml.handlebars index e5c4acf..25ee8b4 100644 --- a/wrapper_app_project/template/android/app/src/main/res/values/strings.xml.handlebars +++ b/wrapper_app_project/template/android/app/src/main/res/values/strings.xml.handlebars @@ -1,3 +1,19 @@ + + {{appName}} diff --git a/wrapper_app_project/template/ios/App/App.xcodeproj/project.pbxproj.handlebars b/wrapper_app_project/template/ios/App/App.xcodeproj/project.pbxproj.handlebars index 09c5964..009cc07 100644 --- a/wrapper_app_project/template/ios/App/App.xcodeproj/project.pbxproj.handlebars +++ b/wrapper_app_project/template/ios/App/App.xcodeproj/project.pbxproj.handlebars @@ -1,4 +1,17 @@ // !$*UTF8*$! +// Copyright 2025 The Outline Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. { archiveVersion = 1; classes = { diff --git a/wrapper_app_project/template/ios/App/App/Config.swift.handlebars b/wrapper_app_project/template/ios/App/App/Config.swift.handlebars index 4c91f6d..0bc9253 100644 --- a/wrapper_app_project/template/ios/App/App/Config.swift.handlebars +++ b/wrapper_app_project/template/ios/App/App/Config.swift.handlebars @@ -1,3 +1,17 @@ +// Copyright 2025 The Outline Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import Foundation struct Config { diff --git a/wrapper_app_project/template/ios/App/App/Info.plist.handlebars b/wrapper_app_project/template/ios/App/App/Info.plist.handlebars index c4be23c..7dacbab 100644 --- a/wrapper_app_project/template/ios/App/App/Info.plist.handlebars +++ b/wrapper_app_project/template/ios/App/App/Info.plist.handlebars @@ -1,3 +1,18 @@ +