monorepo: consolidate all public LunaSea repositories

This commit is contained in:
Jagandeep Brar
2025-04-02 21:53:39 -04:00
parent 9490355792
commit 6ee0bf9a6f
1995 changed files with 18628 additions and 109 deletions

80
.gitignore vendored
View File

@@ -1,81 +1 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store .DS_Store
.atom/
.buildlog/
.history
.svn/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
*.g.dart
# Web related
# Exceptions to above rules.
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
ios/Flutter/.last_build_id
# LunaSea
output/
*.packages
coverage/
lib/system/environment.dart
# XCode Build Artifacts
ios/build/
ios/Runner.app.dSYM.zip
macos/LunaSea.app
macos/LunaSea.app.dSYM.zip
macos/LunaSea.app.zip
# Fastlane
/android/fastlane/report.xml
/ios/fastlane/report.xml
/macos/fastlane/report.xml
/android/fastlane/Preview.html
/ios/fastlane/Preview.html
/macos/fastlane/Preview.html
# Keys & Service Accounts
keys/
android/key.jks
android/key.properties
# Node Dependency directories
node_modules/
jspm_packages/
# Artifacts
output/
*.apk
*.aab
*.ipa
*.dmg
*.pkg
# Linux Artifacts
debian/DEBIAN/md5sums
debian/usr/share/lunasea
*.snap

View File

@@ -1,22 +1,3 @@
# <img width="40px" src="./assets/images/branding_logo.png" alt="LunaSea"></img>&nbsp;&nbsp;LunaSea # <img width="40px" src="./lunasea/assets/images/branding_logo.png" alt="LunaSea"></img>&nbsp;&nbsp;LunaSea
> :warning: **This project is no longer being actively maintained and this repository is archived.** :warning: > This is a mono-repository for archival of the entire LunaSea project.
LunaSea is a fully featured, open source self-hosted controller focused on giving you a seamless experience between all of your self-hosted media software remotely on your devices. LunaSea currently supports:
- [Lidarr](https://github.com/lidarr/lidarr)
- [Radarr](https://github.com/radarr/radarr)
- [Sonarr](https://github.com/sonarr/sonarr)
- [NZBGet](https://github.com/nzbget/nzbget)
- [SABnzbd](https://github.com/sabnzbd/sabnzbd)
- [Newznab Indexer Searching](https://newznab.readthedocs.io/en/latest/misc/api/)
- [NZBHydra2](https://github.com/theotherp/nzbhydra2)
- [Tautulli](https://github.com/Tautulli/Tautulli)
- [Wake on LAN](https://en.wikipedia.org/wiki/Wake-on-LAN)
LunaSea even comes with support for webhook-based push notifications, multiple instances of applications using profiles, backup and restore functionality for your configuration, an AMOLED black theme, and more!
> Please note that LunaSea is purely a remote control application, it does not offer any functionality without software installed on a server/computer.
- [Email](mailto:hello@lunasea.app)
- [Website](https://www.lunasea.app)

View File

@@ -1,8 +0,0 @@
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
/// Stub that allows building the application but with Firebase disabled.
class DefaultFirebaseOptions {
static FirebaseOptions get currentPlatform {
throw UnsupportedError('Firebase is not supported on this platform.');
}
}

View File

@@ -0,0 +1,5 @@
{
"projects": {
"default": "comettools-lunasea"
}
}

66
lunasea-cloud-functions/.gitignore vendored Normal file
View File

@@ -0,0 +1,66 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
firebase-debug.log*
firebase-debug.*.log*
# Firebase cache
.firebase/
# Firebase config
# Uncomment this if you'd like others to create their own Firebase project.
# For a team working on the same Firebase project(s), it is recommended to leave
# it commented so all members can deploy to the same project(s) in .firebaserc.
# .firebaserc
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env

View File

@@ -0,0 +1,9 @@
# LunaSea Cloud Functions
A collection of Cloud Functions that are associated with LunaSea.
## Controllers
| Trigger | Controller |
| :------------ | :--------------------- |
| Auth.onDelete | `deleteUserController` |

View File

@@ -0,0 +1,8 @@
{
"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint",
"npm --prefix \"$RESOURCE_DIR\" run build"
]
}
}

View File

@@ -0,0 +1 @@
.eslintrc.js

View File

@@ -0,0 +1,33 @@
module.exports = {
root: true,
env: {
es6: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"google",
"plugin:@typescript-eslint/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
project: ["tsconfig.json", "tsconfig.dev.json"],
sourceType: "module",
},
ignorePatterns: [
"/lib/**/*", // Ignore built files.
],
plugins: [
"@typescript-eslint",
"import",
],
rules: {
"quotes": ["error", "single"],
"import/no-unresolved": 0,
"indent": ["error", 2],
"object-curly-spacing": [0, "always"],
},
};

View File

@@ -0,0 +1,9 @@
# Compiled JavaScript files
lib/**/*.js
lib/**/*.js.map
# TypeScript v1 declaration files
typings/
# Node.js dependency directory
node_modules/

View File

@@ -0,0 +1 @@
.eslintrc.js

View File

@@ -0,0 +1,10 @@
{
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"bracketSpacing": true,
"arrowParens": "always",
"endOfLine": "lf",
"printWidth": 80
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,30 @@
{
"name": "functions",
"scripts": {
"lint": "eslint --ext .js,.ts .",
"build": "tsc",
"serve": "npm run build && firebase emulators:start --only functions",
"shell": "npm run build && firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"engines": {
"node": "14"
},
"main": "lib/index.js",
"dependencies": {
"firebase-admin": "^10.0.0",
"firebase-functions": "^3.16.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.4.0",
"eslint": "^8.3.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-import": "^2.25.3",
"firebase-functions-test": "^0.3.3",
"typescript": "^4.5.2"
},
"private": true
}

View File

@@ -0,0 +1,9 @@
import * as functions from 'firebase-functions';
import { Firestore, Storage } from '../services';
export const deleteUserController = functions.auth
.user()
.onDelete(async (user: functions.auth.UserRecord) => {
await Firestore.deleteUser(user);
await Storage.deleteUser(user);
});

View File

@@ -0,0 +1,2 @@
import { deleteUserController } from './delete_user';
export { deleteUserController };

View File

@@ -0,0 +1,5 @@
import * as admin from 'firebase-admin';
import { deleteUserController } from './controllers';
admin.initializeApp();
export { deleteUserController };

View File

@@ -0,0 +1,37 @@
import * as admin from 'firebase-admin';
import { getUserRootPath } from './';
export const deleteUser = async (user: admin.auth.UserRecord) => {
try {
const document = admin.firestore().doc(getUserRootPath(user));
if ((await document.get()).exists) {
document
.listCollections()
.then(_processCollections)
.then(() => document.delete())
.then(() => console.log(`Firestore: ${user.uid} Deleted`));
}
} catch (error) {
console.error(error);
}
};
const _processCollections = async (
// eslint-disable-next-line max-len
collections: admin.firestore.CollectionReference<admin.firestore.DocumentData>[],
): Promise<void> => {
collections.forEach((collection) => {
collection.listDocuments().then(_processDocuments);
});
};
const _processDocuments = async (
documents: admin.firestore.DocumentReference<admin.firestore.DocumentData>[],
): Promise<void> => {
documents.forEach((document) => {
document
.listCollections()
.then(_processCollections)
.then(() => document.delete());
});
};

View File

@@ -0,0 +1,6 @@
import * as admin from 'firebase-admin';
import { deleteUser } from './delete_user';
const getUserRootPath = (user: admin.auth.UserRecord) => `users/${user.uid}`;
export { deleteUser, getUserRootPath };

View File

@@ -0,0 +1,3 @@
import * as Firestore from './firestore';
import * as Storage from './storage';
export { Firestore, Storage };

View File

@@ -0,0 +1,17 @@
import * as admin from 'firebase-admin';
import { getBackupBucket } from './';
export const deleteUser = async (user: admin.auth.UserRecord) => {
try {
const bucket = getBackupBucket();
if (await bucket.exists()) {
bucket
.deleteFiles({
prefix: `${user.uid}/`,
})
.then(() => console.log(`Storage: ${user.uid} Deleted`));
}
} catch (error) {
console.error(error);
}
};

View File

@@ -0,0 +1,6 @@
import * as admin from 'firebase-admin';
import { deleteUser } from './delete_user';
const getBackupBucket = () => admin.storage().bucket('backup.lunasea.app');
export { deleteUser, getBackupBucket };

View File

@@ -0,0 +1,5 @@
{
"include": [
".eslintrc.js"
]
}

View File

@@ -0,0 +1,15 @@
{
"compilerOptions": {
"module": "commonjs",
"noImplicitReturns": true,
"noUnusedLocals": true,
"outDir": "lib",
"sourceMap": true,
"strict": true,
"target": "es2017"
},
"compileOnSave": true,
"include": [
"src"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 KiB

37
lunasea-docs/README.md Normal file
View File

@@ -0,0 +1,37 @@
# LunaSea
LunaSea is a fully featured, open source self-hosted controller focused on giving you a seamless experience between all of your self-hosted media software remotely on your devices.
## Modules
* [Lidarr](modules/lidarr.md)
* [Newznab Search (including NZBHydra2)](modules/newznab-search.md)
* [NZBGet](modules/nzbget.md)
* [Radarr](modules/radarr.md)
* [SABnzbd](modules/sabnzbd.md)
* [Sonarr](modules/sonarr.md)
* [Tautulli](modules/tautulli.md)
* [Wake on LAN](modules/wake-on-lan.md)
LunaSea even comes with support for webhook-based push notifications, multiple instances of applications using profiles, backup and restore functionality for your configuration, an AMOLED black theme, and more!
{% hint style="info" %}
LunaSea is purely a remote control application, it does not offer any functionality without software installed on a server/computer.
{% endhint %}
## Releases
All releases for every build channel can be downloaded from the [build bucket](https://builds.lunasea.app/), and all stable releases for all platforms are also available on [GitHub](https://github.com/JagandeepBrar/LunaSea/releases).
* [Android](releases/android.md)
* [iOS](releases/ios.md)
* [Linux](releases/linux.md)
* [macOS](releases/macos.md)
* [Web](releases/web.md)
* [Windows](releases/windows.md)
Interested in using prerelease build channels of LunaSea? Learn the differences between all the build channels and how to join one [here](getting-started/build-channels.md)!
## License
See [LICENSE.md](https://github.com/JagandeepBrar/LunaSea/blob/master/LICENSE.md) for more information.

45
lunasea-docs/SUMMARY.md Normal file
View File

@@ -0,0 +1,45 @@
# Table of contents
* [LunaSea](README.md)
## Getting Started
* [Build Channels](getting-started/build-channels.md)
* [Donations](getting-started/donations.md)
* [Frequently Asked Questions](getting-started/frequently-asked-questions.md)
* [Platform Restrictions](getting-started/platform-restrictions.md)
## LunaSea
* [Cloud Account](lunasea/cloud-account.md)
* [Local Backup & Restore](lunasea/local-backup-and-restore.md)
* [Logs](lunasea/logs.md)
* [Notifications](lunasea/notifications/README.md)
* [Lidarr](lunasea/notifications/lidarr.md)
* [Overseerr](lunasea/notifications/overseerr.md)
* [Radarr](lunasea/notifications/radarr.md)
* [Sonarr](lunasea/notifications/sonarr.md)
* [Tautulli](lunasea/notifications/tautulli.md)
* [Custom Notifications](lunasea/notifications/custom-notifications.md)
* [Profiles](lunasea/profiles.md)
## Modules
* [Lidarr](modules/lidarr.md)
* [Newznab Search](modules/newznab-search.md)
* [NZBGet](modules/nzbget.md)
* [Overseerr](modules/overseerr.md)
* [Radarr](modules/radarr.md)
* [SABnzbd](modules/sabnzbd.md)
* [Sonarr](modules/sonarr.md)
* [Tautulli](modules/tautulli.md)
* [Wake on LAN](modules/wake-on-lan.md)
## Releases
* [Android](releases/android.md)
* [iOS](releases/ios.md)
* [Linux](releases/linux.md)
* [macOS](releases/macos.md)
* [Web](releases/web.md)
* [Windows](releases/windows.md)

View File

@@ -0,0 +1,24 @@
# Build Channels
LunaSea offers four different build channels, each of which supply signed and notarized copies of LunaSea.
All releases for every build channel can be downloaded from the [build bucket](https://builds.lunasea.app/), and all stable releases for all platforms are also available on [GitHub](https://github.com/JagandeepBrar/LunaSea/releases).
## Stable
This is the store version and will remain the most stable version. No in-progress features will be deployed to this channel.
## Beta
This channel is focused around _early previews and testing of work-in-progress features_. This channel is intended to allow users to give feedback to the developer on features that are actively being worked on.
## Edge
This channel's purpose is to _ensure that every commit made to master is building across all platforms_ and allows for easier access to a build for each commit. This is not intended to be used by the average user, but is for community developers or users who need to test a recently added fix that has not yet reached the beta channel.
There are no restrictions on features in these builds (barring a very specific subset used for debugging/testing) so it gives full access to everything that is work in progress.
{% hint style="warning" %}
**Do not expect a fully stable experience if you use these builds**, as it is entirely possible that a single build could cause problems including but not limited to database corruption. If you are running these builds, please ensure you have either a cloud or offline backup available for easy restoration.
{% endhint %}

View File

@@ -0,0 +1,24 @@
# Donations
Thanks for considering donating to LunaSea! Donations are what keep the project alive and completely free for everyone to use.
## In-App Purchases
If you have downloaded LunaSea through the Play Store or App Store, you can directly donate using in-app purchases! Simply head to the Settings and tap the "Donations" tile. There are four options available (all scaled to USD): **$0.99, $2.99, $4.99, and $9.99**.
{% hint style="warning" %}
If you are using TestFlight builds on iOS devices, you will need to switch to the App Store version to donate. Any in-app purchases executed on a TestFlight build do not actually get processed.
{% endhint %}
## Ko-Fi
I have setup a [Ko-Fi page](https://ko-fi.com/jagandeepbrar) for LunaSea!
Ko-Fi allows you to make a one-time donation in $1 increments using PayPal.
## GitHub Sponsors
I have setup a [GitHub Sponsors](https://github.com/sponsors/JagandeepBrar) account!
GitHub Sponsors allow you to setup a recurring donation in the amount of $1 to $5.

View File

@@ -0,0 +1,106 @@
# Frequently Asked Questions
Read about some frequently asked questions related to LunaSea, development, and getting support for LunaSea!
## Modules
### How Do I Install a "Module"?
The software, or as used in LunaSea, _Modules_, are all pieces of software that must be installed on a home computer or server. None of the currently supported software has been developed by me, so the amount of support offered for each module is limited. LunaSea itself does not have the functionality of that software, it acts as a remote.
### Why Isn't Feature/Module "X" Supported Yet?
LunaSea is only developed by one person and while I try to put as much time into LunaSea as I can, I still do have a family, career, and I want to enjoy my personal time.
I also want to point out that I don't want to make LunaSea a wide ranging but no depth application. I want every application to have as full of an implementation as possible, which can mean that new modules will take time to get implemented between one another.
### Torrent Client Support: Is It Coming?
Support for torrent clients is easily the most requested new module, and I definitely see the demand. However, torrent support currently is not possible in LunaSea because of the restrictions Apple has put forward. Apple does not allow integration of P2P/torrent clients in any capacity for applications that are hosted on the App Store. This includes a P2P client that runs directly on the device and linking to a P2P client that is running on an external machine.
Torrent support is not completely off the table and may come in the future! But at the moment, over 90% of the active user base is using iOS-based devices and it is hard to justify building a module (that takes a lot of time) that the mass majority of the user base would not be able to use.
{% hint style="info" %}
I am actively thinking of methods to get around this limitation, if you have any ideas consider commenting on the torrent client support [feedback board request](https://feedback.lunasea.app/b/New-Modules/p/torrent-clients-support).
{% endhint %}
## Development
### Who Makes LunaSea?
Only one person, me! Hi, my name is Jagandeep, and I am a software engineer from Canada. I am currently the main and only developer on LunaSea but I encourage anyone who is interested and wants to contribute to the project to make a pull request on GitHub!
### What is LunaSea Developed In?
LunaSea is developed using Google's hybrid framework, [Flutter](https://flutter.dev/), which uses [Dart](https://dart.dev/) as its core language. Using Flutter allows an indie developer like myself to build cross-platform applications more easily, as it is one single codebase that allows me to build across many platforms!
### How is LunaSea Free?
LunaSea started off as (and still is) a passion project fueled by my love for data hoarding. It was open-sourced soon after it's initial launch to allow LunaSea to get into the hands of as many users as possible and to give back to the community where there is a lack of open-source, high quality mobile applications.
### Are You Ever Going To Charge Money/Insert Ads?
The only possible reason that LunaSea will ever have any kind of payment model is if features are introduced that cost me recurring charges that are too large to bear. Any and all features that do not incur me a charge will be free, and even any features that would cost me money will become open-source, which offers everyone the ability to have a completely free experience in LunaSea.
## Bugs & Feedback
### I Found a Bug! How Do I Let You Know?
I tried to make it as stable as possible, but bugs obviously will always be there. If you do run into a bug (especially a fatal/crashing bug), please also attach the logs from the application into the report - logs can be exported from the settings.
* [GitHub Issues](https://www.lunasea.app/github): The best place to alert me of new issues is directly on the GitHub page. Please try to follow the template for bug reports, but again I am not overly strict and a good explanation of the issue will suffice (this may change in the future if it gets increasingly hard to manage).
* [Discord](https://www.lunasea.app/discord)
* [Email](https://docs.lunasea.appmailto:hello@lunasea.app/)
* [Reddit](https://www.lunasea.app/reddit)
### How Can I Request a New Feature?
I consider all feedback and actively try to integrate new features that are requested by the community, big or small! You have a few ways to request new features for LunaSea:
* [Discord](https://www.lunasea.app/discord)
* [Email](https://docs.lunasea.appmailto:hello@lunasea.app/)
* [Reddit](https://www.lunasea.app/reddit)
{% hint style="info" %}
I may not have the ability to respond to all requests directly, but please be ensured I do read everything!
{% endhint %}
## Support
### Why Don't The Settings Explain Much?
I understand that the settings section could definitely use better documentation and linking, but this ambiguity and sparse documentation directly within LunaSea is by design.
LunaSea took quite a runaround to initially get on the App Store because of its relationship with how you acquire Linux ISOs. After successfully getting it on the App Store, I want to avoid adding anything to LunaSea that would potentially get it revoked.
### "X" Won't Connect, Help!
The initial setup can either be incredibly easy or make you want to pull your hair out, I get that and that's what the community is here for! Please feel free to send a message to any of the listed methods to get support where either I or an awesome user in the community will surely come to help you out:
* [Discord](https://www.lunasea.app/discord)
* [Email](https://docs.lunasea.appmailto:hello@lunasea.app/)
* [Reddit](https://www.lunasea.app/reddit)
A few quick tips on common problems:
* `localhost` and `0.0.0.0` are internal hostnames that means "this computer". They cannot and should not be used as the host, but is commonly used because users mainly access the service from the computer running it. In order for LunaSea to connect, you must find the local IP of your computer (most common home networking configurations have it start with `192.168.0.x` or `192.168.1.x`)
* Ensure you match the right API key to the right service. I know this seems like an obvious thing, but you'd be surprised how easy it is to mix up 3-4 API keys when you're going back and forth copying and pasting!
* For the -arr services, ensure the binding address in the advanced general settings is not set to `127.0.0.1` or `localhost`, but instead set to either `0.0.0.0`, `*`, or the local IP for the computer/server.
* Similarly for the clients, ensure that the host is set to `0.0.0.0`, or the local IP.
* As noted in the host prompt, you must add either `http://` or `https://` before the IP or domain. LunaSea does not make any assumptions on the protocol to use (http or https).
* Do not use `3xx` redirecting webpages. This is not supported for POST and PUT requests (sending data back to the module) and can cause many headaches, so ideally you should be pointing directly to the module on your network.
* _(Windows Only)_: For a lot of software to correctly bind to your network, you need to ensure that you run the software as administrator. This is specifically very important for the -arrs, which will only bind to your host machine if you do not run it as administrator.
### How Can I Access My Services Remotely?
While this is outside of the scope of this project, I can try to point you in the right direction!
* **Reverse Proxy**: A reverse proxy allows you to open 1 or 2 ports on your network (typically 443 for SSL/https connections and 80 for http connections). Using a reverse proxy also allows you to attach a domain name to your IP and generate a free SSL certificate for https (hint, [LetsEncrypt](https://letsencrypt.org/)). Some common options for reverse proxies are [NGINX Proxy Manager](https://nginxproxymanager.com/), [Traefik](https://traefik.io/), [NGINX](https://nginx.org/), and [Apache](https://www.apache.org/).
* **VPN Tunnelling**: Another option is to create a VPN tunnel back to your home network, which would allow you to access your services as if you are on your home network. Tools like [WireGuard](https://www.wireguard.com/) and [OpenVPN](https://openvpn.net/) are perfect for this use case. This is technically the most secure method, but a bit less convenient than using a reverse proxy.
* **Direct Port Forwarding**: This method is _not recommended_, but another option is directly forward the ports of the services on your router and access the services via `<External IP>:<Port>`. The reason this is not recommended is because all of the traffic is sent unencrypted (you can use self-signed certificates, but this causes more headaches related to certificate authorities), and the more ports that are open on your network the less secure it is.
### I Want to Complain! Where Can I Complain?
Sorry that LunaSea is not meeting your expectations, feel free to post criticisms or complaints to any of the social platforms or directly [email me](https://docs.lunasea.appmailto:hello@lunasea.app/). I hope that I can remedy your complaints, all I ask is that you do not be abusive or disrespectful to myself or others in the community.
I also kindly request that before you submit a 1-star App Store/Play Store review that you consider contacting me directly with your complaints. 1-star reviews can really hurt a smaller application's rating since we do not typically get lots of reviews.

View File

@@ -0,0 +1,99 @@
# Platform Restrictions
Below showcases which modules or features may not be supported on each platform.
{% hint style="info" %}
Work will continuously be done to try to achieve 100% feature parity between all platforms when possible!
{% endhint %}
## Module Support
If a module is not listed, you can assume that every platform has full support for said module!
### NZBGet
| Platform | Supported? |
| :------: | :--------: |
| Android | ✅ |
| iOS | ✅ |
| Linux | ✅ |
| macOS | ✅ |
| Windows | ✅ |
| Web | ❌ |
### Overseerr
| Platform | Supported? |
| :------: | :--------: |
| Android | ✅ |
| iOS | ✅ |
| Linux | ✅ |
| macOS | ✅ |
| Windows | ✅ |
| Web | ❌ |
### Tautulli
| Platform | Supported? |
| :------: | :--------: |
| Android | ✅ |
| iOS | ✅ |
| Linux | ✅ |
| macOS | ✅ |
| Windows | ✅ |
| Web | ❌ |
### Wake on LAN
| Platform | Supported? |
| :------: | :--------: |
| Android | ✅ |
| iOS | ✅ |
| Linux | ✅ |
| macOS | ✅ |
| Windows | ✅ |
| Web | ❌ |
## Feature Support
If a feature is not listed, you can assume that every platform has full support for said feature!
### LunaSea Cloud Account
| Platform | Supported? |
| :---------------: | :--------: |
| Android | ✅ |
| iOS | ✅ |
| Linux | ❌ |
| macOS | ✅ |
| Windows | ❌ |
| Web (Hosted) | ✅ |
| Web (Self-Hosted) | ❌ |
### Push Notifications
| Platform | Supported? |
| :---------------: | :--------: |
| Android | ✅ |
| iOS | ✅ |
| Linux | ❌ |
| macOS | ✅ |
| Windows | ❌ |
| Web (Hosted) | ✅ |
| Web (Self-Hosted) | ❌ |
## Web-Specific Restrictions
### **HTTPS Requirement**
LunaSea's web instances are hosted on [Netlify](https://www.netlify.com/) and use [Let's Encrypt](https://letsencrypt.org/) TLS certificates to ensure that an encrypted connection is utilized when loading the LunaSea web application package.
One limitation this incurs is that most modern web browsers no longer support [mixed content](https://developer.mozilla.org/en-US/docs/Web/Security/Mixed\_content), so it is required when using these browsers to utilize a reverse proxy (or something similar) to expose a secure (`HTTPS`) connection to your instances even when hosted on the same machine.
{% hint style="warning" %}
**All network communication occurs directly between your web browser and host machine**, but this is a limitation put forward by the web browsers.
{% endhint %}
### Wake on LAN Support
Wake on LAN support will **never** be supported when using LunaSea on the web, because the Wake on LAN protocol relies on the [User Datagram Protocol (UDP)](https://en.wikipedia.org/wiki/User\_Datagram\_Protocol). UDP connections are not supported in the web browser because of underlying security constraints, and so it will not be possible to utilize wake on LAN now or at any point in the future when using LunaSea on the web.

View File

@@ -0,0 +1,19 @@
# Cloud Account
LunaSea currently offers a **free** cloud account that can be used for extending the functionality of LunaSea. The only details required to register for an account are an email address and password. At no point will LunaSea or the developers send you any emails, unless you explicitly request a password reset email.
{% hint style="info" %}
If you want to protect your privacy, you are free to use a fake email when registering for an account, as there is no required account verification.
Be warned that you will be unable to reset or change your password if you decide to use a fake email, as these functions are handled through Firebase Authentication via email.
{% endhint %}
## Encrypted Cloud Configuration Storage
The three options related to backing up your encrypted backups should be self-explanatory. All configurations are encrypted **on-device** before being sent off the device. When restoring an encrypted backup, the encrypted backup is downloaded to the device and you will be prompted to decrypt the backup **on-device**.
Deleting a backup is a permanent action, there is **no way to restore that backup**.
{% hint style="warning" %}
Because all encryption and decryption occurs on-device, it is fully end-to-end encrypted. Forgetting the encryption password will result in there being no way to retrieve the configuration.
{% endhint %}

View File

@@ -0,0 +1,19 @@
# Local Backup & Restore
Alongside cloud-based backups, LunaSea offers the ability to create local backups of your configuration which you can manually transfer between devices and restore from. This gives you the freedom to have complete control of your data, and never have your configuration saved in a cloud server. Local backups are fully encrypted on-device, there is currently no option to create a non-encrypted backup.
{% hint style="warning" %}
Because all encryption and decryption occurs on-device, it is fully end-to-end encrypted. Forgetting the encryption password will result in there being no way to retrieve the configuration.
{% endhint %}
## Creating a Backup
Creating a backup in LunaSea is simple and painless! Simply go to Settings -> System -> "Backup to Device" to start the backup process.
The backup will use the system-level share menu or dialog prompt to allow you to save the backup (a `.lunasea` file). Please ensure to keep the `.lunasea` extension when saving the file, as backups without a `.lunasea` extension will not be selectable when attempting to restore your configuration.
## Restoring a Backup
Restoring a backup in LunaSea is as simple as creating the backup! Simply go to Settings -> System -> "Restore from Device" to start the restore process.
The restoration process will request the password used to encrypt the original backup.

View File

@@ -0,0 +1,51 @@
# Logs
LunaSea includes an on-device logging system that helps debug crashes, issues, and support requests. LunaSea stores 4 different levels of logs: **Debug**, **Warning**, **Error**, and **Critical**.
{% tabs %}
{% tab title="Debug" %}
Debug logs are informational logs and messages that are intended to help debug processes.
{% endtab %}
{% tab title="Warning" %}
Warning logs are non-crashing and non-critical errors that have occurred on the device.
Warning logs would occur when failing to load an image, passing an incorrect encryption key when trying to restore a backup, etc.
{% endtab %}
{% tab title="Error" %}
Error logs are non-crashing but critical errors that have occurred on the device. Error logs would occur on network errors, connection issues, errors returned from the module, etc.
{% endtab %}
{% tab title="Critical" %}
Critical logs are crashing errors or unhandled errors that have occurred on the device. Critical logs would occur when LunaSea fails to complete the boot process, fails to render the UI, etc.
{% endtab %}
{% endtabs %}
## Viewing Log History
When a _handled_ error occurs, a toast notification will appear that allows you to directly view the error that just occurred.
LunaSea also stores a list of the **last 100 logs** that have occurred on the device. To access the history of logs, go to Settings -> System -> Logs.
{% hint style="info" %}
The log database size is checked on startup, so all logs that have occurred in the active session will remain in the log history until LunaSea is closed and reopened.
{% endhint %}
## Exporting Logs
LunaSea offers the ability to export your logs into a JSON file, which can be easily sent to the developer to help debug the problems. The exported logs also include additional information, including the code-execution stack trace to see exactly where in the code the error occurred.
To export your logs, go to Settings -> System -> Logs -> "Export" to trigger an export of your logs. A system-level share menu or dialog prompt will appear with the ability to share or save the exported logs to your device.
{% hint style="warning" %}
Because the exported logs contain code-execution stack traces, **the logs may unintentionally contain private information**.
Please ensure you do not publicly share your exported logs (or before sharing, manually scrub the exported logs). Only share the logs to trusted parties through private channels such as email or direct messages.
{% endhint %}
## Clearing Logs
LunaSea offers the ability to clear all recorded logs from your device. While an available option, it is not recommended to clear your logs often as LunaSea will internally ensure the log database does not grow to an obscenely large size.
To clear your logs, go to Settings -> System -> Logs -> "Clear" to trigger a clean of the logs database.

View File

@@ -0,0 +1,59 @@
# Notifications
Many of the supported modules have support for webhooks, which we can utilize with the hosted notification relay to get rich, instant notifications with deep-linking support sent as push notifications directly to your devices running LunaSea!
{% hint style="info" %}
Push notifications are only available on LunaSea installations from official store releases.
On Android devices, Google Play Services must be installed on the device to receive notifications.
{% endhint %}
## Platform Support
Notifications are only supported on a limited set of platforms at this time because of the availability of Firebase tooling. As support for additional platforms are added to the tooling they will also be added to LunaSea!
| Platform | Supported? |
| :---------------: | :--------: |
| Android | ✅ |
| iOS | ✅ |
| Linux | ❌ |
| macOS | ✅ |
| Web (Hosted) | ✅ |
| Web (Self-Hosted) | ❌ |
| Windows | ❌ |
## Module Support
| Module | Supported? | Deep Linking? |
| :-----------------------: | :--------: | :-----------: |
| [Lidarr](lidarr.md) | ✅ | ❌ |
| NZBGet | ❌ | ❌ |
| [Overseerr](overseerr.md) | ✅ | ❌ |
| [Radarr](radarr.md) | ✅ | ✅ |
| SABnzbd | ❌ | ❌ |
| [Sonarr](sonarr.md) | ✅ | ✅ |
| [Tautulli](tautulli.md) | ✅ | ✅ |
## Notification Types
LunaSea supports two different types of notifications: **User-Based** and **Device-Based**.
{% tabs %}
{% tab title="User-Based" %}
User-based notifications send notifications to all devices that are linked to your LunaSea account. Your device is automatically linked when you register or sign in to your account. This means that any current and future devices that are signed-in to your account will receive notifications automatically.
{% endtab %}
{% tab title="Device-Based" %}
Device-based notifications send notifications to a single, specific device. Device-based notifications do not require a LunaSea account, but require you to register every device as a new webhook in the module.
{% endtab %}
{% endtabs %}
## Getting Your Webhook URLs
To get the correct webhook URL for each module, simply head to the Settings within LunaSea, then into the "Notifications" page! The buttons on each module card will copy the **full, constructed webhook URL** to receive user-based or device-based notifications for that specific module. Please ensure to copy and use the correct webhook URL for each module, as mixing them up can lead to unexpected results.
{% hint style="warning" %}
**Do not publicly share your user-based or device-based URL!**
Anyone with access to your user or device webhook URLs can send notifications to your account or device.
{% endhint %}

View File

@@ -0,0 +1,134 @@
# Custom Notifications
## Preparation
{% hint style="warning" %}
Custom notifications are considered an advanced feature, and requires basic knowledge of JSON syntax and creating your own scripts/tools to handle sending the payloads.
{% endhint %}
* Read through the main [Notifications](./) page
* Copy any module's device-based or user-based webhook URL from LunaSea
You will need to slightly modify the webhook URL you have copied from any of the modules. Simply replace the name of the module within the webhook URL to `custom` and you're good to go!
Alternatively, you can copy the content of the URL after the last slash (after `device/` or `user/`) to obtain your Firebase device or user identifier.
## Endpoints
Custom notifications are supported by both device-based and user-based notifications, with full endpoint details below:
{% swagger baseUrl="https://notify.lunasea.app" path="/v1/custom/device/:device_id" method="post" summary="Device-Based" %}
{% swagger-description %}
Send a custom notification using a device token to a single device running LunaSea.
{% endswagger-description %}
{% swagger-parameter name="device_id" type="string" in="path" required="true" %}
The Firebase device identifier
{% endswagger-parameter %}
{% swagger-parameter name="title" type="string" in="body" required="true" %}
The notification's title.
{% endswagger-parameter %}
{% swagger-parameter name="body" type="string" in="body" required="true" %}
The notification's body content.
{% endswagger-parameter %}
{% swagger-parameter name="image" type="string" in="body" required="false" %}
A
**publicly accessible**
URL to an image that will be attached to the notification.
{% endswagger-parameter %}
{% swagger-response status="200" description="" %}
```javascript
{
"status": "OK"
}
```
{% endswagger-response %}
{% swagger-response status="500" description="" %}
```javascript
{
"status": "Internal Server Error"
}
```
{% endswagger-response %}
{% endswagger %}
{% swagger baseUrl="https://notify.lunasea.app" path="/v1/custom/user/:user_id" method="post" summary="User-Based" %}
{% swagger-description %}
Send a custom notification using a user token to all devices signed into that LunaSea account.
{% endswagger-description %}
{% swagger-parameter name="user_id" type="string" in="path" required="true" %}
The Firebase user identifier
{% endswagger-parameter %}
{% swagger-parameter name="title" type="string" in="body" required="true" %}
The notification's title.
{% endswagger-parameter %}
{% swagger-parameter name="body" type="string" in="body" required="true" %}
The notification's body content.
{% endswagger-parameter %}
{% swagger-parameter name="image" type="string" in="body" required="false" %}
A
**publicly accessible**
URL to an image that will be attached to the notification.
{% endswagger-parameter %}
{% swagger-response status="200" description="" %}
```javascript
{
"status": "OK"
}
```
{% endswagger-response %}
{% swagger-response status="400" description="" %}
```javascript
{
"status": "No devices found"
}
```
{% endswagger-response %}
{% swagger-response status="404" description="" %}
```javascript
{
"status": "Invalid User ID"
}
```
{% endswagger-response %}
{% swagger-response status="500" description="" %}
```javascript
{
"status": "Internal Server Error"
}
```
{% endswagger-response %}
{% endswagger %}
## Troubleshooting
* Ensure that the required `title` parameter is a string type.
* If the type is not a string, the notification will fail.
* Sending no value or a null value will result in the title "Unknown Title" being used.
* Ensure that the required `body` parameter is a string type.
* If the type is not a string, the notification will fail.
* Sending no value or a null value will result in the body "Unknown Content" being used.
* If sending an image, ensure that the content is a valid URL.
* If the content is not a valid URL, the notification will fail.
* The URL must contain the protocol, `http://` or `https://`.
* The URL must be a direct link to the image and does not redirect.
* The URL must be publicly accessible, not requiring any authentication to access.
* If sending an image, the image must be a supported image type.
* Supported types include JPGs, PNGs, and animated GIFs.

View File

@@ -0,0 +1,77 @@
# Lidarr
## Preparation
* Read through the main [Notifications](./) page
* Copy your device-based or user-based webhook URL from LunaSea
## Setup the Webhook
In Lidarr's web GUI, head to Settings -> Connect, hit the "+" button to add a new connection and select "Webhook". Please follow each section below to setup the webhook:
{% tabs %}
{% tab title="Name" %}
Select any name, for example "LunaSea".
{% endtab %}
{% tab title="Triggers" %}
Select which events should trigger a push notification. The following triggers are supported:
| Trigger | Supported? |
| :---------------------: | :--------: |
| On Grab | ✅ |
| On Release Import | ✅ |
| On Upgrade | ✅ |
| On Download Failure | ❌ |
| On Import Failure | ❌ |
| On Rename | ✅ |
| On Track Retag | ✅ |
| On Application Update | ❌ |
| On Health Issue | ❌ |
| Include Health Warnings | ❌ |
{% endtab %}
{% tab title="Tags" %}
You can _**optionally**_ select a tag that must be attached to an artist for the webhook to get triggered.
This can be useful when working with a large media collection to only receive notifications for content you are actively monitoring.
If you want to receive notifications for all artists, leave the tags area empty.
{% endtab %}
{% tab title="URL" %}
Paste the full device-based or user-based URL that was copied from LunaSea.
Each webhook can support a single user-based or device-based webhook URL. Attaching multiple device-based or user-based webhooks to a single Lidarr instance requires setting up multiple webhooks.
{% endtab %}
{% tab title="Method" %}
Keep the method on "**POST**". Changing the method to "**PUT**" will cause the webhooks to fail.
{% endtab %}
{% tab title="Username" %}
The username field should be an **exact match** to the profile that this module instance was added to within LunaSea. Capitalization and punctuation _does_ matter.
{% hint style="warning" %}
This step is only required if you are _**not**_ using the default LunaSea profile (`default`). LunaSea will assume the default profile when none is supplied.
Correctly setting up this field is critically important to get full deep-linking support.
{% endhint %}
{% endtab %}
{% tab title="Password" %}
Leave the password field empty. Setting this field will currently have no effect.
{% endtab %}
{% endtabs %}
Once setup, close LunaSea and run the webhook test in Lidarr. You should receive a new notification letting you know that LunaSea is ready to receive Lidarr notifications!
## Example
An example Lidarr webhook can be seen below:
* No tags are set for this webhook, meaning all artists will trigger a notification.
* This is a user-based notification webhook, meaning it will be sent to all devices that are linked to the user ID `1234567890`.
* The webhook is associated with the profile named `My Profile`.
![](<../../.gitbook/assets/lidarr\_notification\_example (1).png>)

View File

@@ -0,0 +1,56 @@
# Overseerr
## Preparation
* Read through the main [Notifications](./) page
* Copy your device-based or user-based webhook URL from LunaSea
## Setup the Webhook
In Overseerr's web GUI, head to Settings -> Notifications -> LunaSea. Ensure that the agent is enabled, then follow each section below to setup the webhook:
{% tabs %}
{% tab title="Webhook URL" %}
Paste the full device-based or user-based URL that was copied from LunaSea.
Overseerr currently only supports 1 LunaSea notification agent, which means you can only setup a single user-based or device-based notification.
{% endtab %}
{% tab title="Profile Name" %}
The profile name field should be an **exact match** to the profile that this module instance was added to within LunaSea. Capitalization and punctuation _does_ matter.
{% hint style="warning" %}
This step is only required if you are _**not**_ using the default LunaSea profile (`default`). LunaSea will assume the default profile when none is supplied.
Correctly setting up this field is critically important to get full deep-linking support.
{% endhint %}
{% endtab %}
{% tab title="Notification Types" %}
Select which events should trigger a push notification. The following triggers are supported:
| Trigger | Supported? |
| :----------------------------: | :--------: |
| Request Pending Approval | ✅ |
| Request Automatically Approved | ✅ |
| Request Approved | ✅ |
| Request Declined | ✅ |
| Request Available | ✅ |
| Request Processing Failed | ✅ |
| Issue Reported | ✅ |
| Issue Comment | ✅ |
| Issue Resolved | ✅ |
| Issue Reopened | ✅ |
{% endtab %}
{% endtabs %}
Once setup, close LunaSea and run the webhook test in Overseerr. You should receive a new notification letting you know that LunaSea is ready to receive Overseerr notifications!
## Example
An example Overseerr webhook can be seen below:
* This is a user-based notification webhook, meaning it will be sent to all devices that are linked to the user ID `1234567890`.
* The webhook is associated with the profile named `My Profile`.
![](<../../.gitbook/assets/overseerr\_notification\_sample\_v2 (1).png>)

View File

@@ -0,0 +1,77 @@
# Radarr
## Preparation
* Read through the main [Notifications](./) page
* Copy your device-based or user-based webhook URL from LunaSea
## Setup the Webhook
In Radarr's web GUI, head to Settings -> Connect, hit the "+" button to add a new connection and select "Webhook". Please follow each section below to setup the webhook:
{% tabs %}
{% tab title="Name" %}
Select any name, for example "LunaSea".
{% endtab %}
{% tab title="Triggers" %}
Select which events should trigger a push notification. The following triggers are supported:
| Trigger | Supported? |
| :------------------------------: | :--------: |
| On Grab | ✅ |
| On Import | ✅ |
| On Upgrade | ✅ |
| On Rename | ✅ |
| On Movie Delete | ❌ |
| On Movie File Delete | ❌ |
| On Movie File Delete For Upgrade | ❌ |
| On Health Issue | ✅ |
| Include Health Warnings | ✅ |
| On Application Update | ❌ |
{% endtab %}
{% tab title="Tags" %}
You can _**optionally**_ select a tag that must be attached to a movie for the webhook to get triggered.
This can be useful when working with a large media collection to only receive notifications for content you are actively monitoring.
If you want to receive notifications for all movies, leave the tags area empty.
{% endtab %}
{% tab title="URL" %}
Paste the full device-based or user-based URL that was copied from LunaSea.
Each webhook can support a single user-based or device-based webhook URL. Attaching multiple device-based or user-based webhooks to a single Radarr instance requires setting up multiple webhooks.
{% endtab %}
{% tab title="Method" %}
Keep the method on "**POST**". Changing the method to "**PUT**" will cause the webhooks to fail.
{% endtab %}
{% tab title="Username" %}
The username field should be an **exact match** to the profile that this module instance was added to within LunaSea. Capitalization and punctuation _does_ matter.
{% hint style="warning" %}
This step is only required if you are _**not**_ using the default LunaSea profile (`default`). LunaSea will assume the default profile when none is supplied.
Correctly setting up this field is critically important to get full deep-linking support.
{% endhint %}
{% endtab %}
{% tab title="Password" %}
Leave the password field empty. Setting this field will currently have no effect.
{% endtab %}
{% endtabs %}
Once setup, close LunaSea and run the webhook test in Radarr. You should receive a new notification letting you know that LunaSea is ready to receive Radarr notifications!
## Example
An example Radarr webhook can be seen below:
* No tags are set for this webhook, meaning all movies will trigger a notification.
* This is a user-based notification webhook, meaning it will be sent to all devices that are linked to the user ID `1234567890`.
* The webhook is associated with the profile named `My Profile`.
![](../../.gitbook/assets/radarr\_notification\_example.png)

View File

@@ -0,0 +1,77 @@
# Sonarr
## Preparation
* Read through the main [Notifications](./) page
* Copy your device-based or user-based webhook URL from LunaSea
## Setup the Webhook
In Sonarr's web GUI, head to Settings -> Connect, hit the "+" button to add a new connection and select "Webhook". Please follow each section below to setup the webhook:
{% tabs %}
{% tab title="Name" %}
Select any name, for example "LunaSea".
{% endtab %}
{% tab title="Triggers" %}
Select which events should trigger a push notification. The following triggers are supported:
| Trigger | Supported? |
| :--------------------------------: | :--------: |
| On Grab | ✅ |
| On Import | ✅ |
| On Upgrade | ✅ |
| On Rename | ✅ |
| On Series Delete | ❌ |
| On Episode File Delete | ❌ |
| On Episode File Delete For Upgrade | ❌ |
| On Health Issue | ✅ |
| Include Health Warnings | ✅ |
| On Application Update | ❌ |
{% endtab %}
{% tab title="Tags" %}
You can _**optionally**_ select a tag that must be attached to a series for the webhook to get triggered.
This can be useful when working with a large media collection to only receive notifications for content you are actively monitoring.
If you want to receive notifications for all series, leave the tags area empty.
{% endtab %}
{% tab title="URL" %}
Paste the full device-based or user-based URL that was copied from LunaSea.
Each webhook can support a single user-based or device-based webhook URL. Attaching multiple device-based or user-based webhooks to a single Sonarr instance requires setting up multiple webhooks.
{% endtab %}
{% tab title="Method" %}
Keep the method on "**POST**". Changing the method to "**PUT**" will cause the webhooks to fail.
{% endtab %}
{% tab title="Username" %}
{% hint style="warning" %}
This step is only required if you are _**not**_ using the default LunaSea profile (`default`). LunaSea will assume the default profile when none is supplied.
Correctly setting up this field is critically important to get full deep-linking support.
{% endhint %}
The username field should be an **exact match** to the profile that this module instance was added to within LunaSea. Capitalization and punctuation _does_ matter.
{% endtab %}
{% tab title="Password" %}
Leave the password field empty. Setting this field will currently have no effect.
{% endtab %}
{% endtabs %}
Once setup, close LunaSea and run the webhook test in Sonarr. You should receive a new notification letting you know that LunaSea is ready to receive Sonarr notifications!
## Example
An example Sonarr webhook can be seen below:
* No tags are set for this webhook, meaning all series will trigger a notification.
* This is a user-based notification webhook, meaning it will be sent to all devices that are linked to the user ID `1234567890`.
* The webhook is associated with the profile named `My Profile`.
![](../../.gitbook/assets/sonarr\_notification\_example.png)

View File

@@ -0,0 +1,81 @@
# Tautulli
## Preparation
* Read through the main [Notifications](./) page
* Copy your device-based or user-based webhook URL from LunaSea
## Setup the Webhook
In Tautulli's web GUI, head to Settings -> Notification Agents, hit the "Add a new notification agent" button and select "LunaSea". Please follow each section below to setup the webhook:
{% tabs %}
{% tab title="Configuration" %}
**LunaSea Webhook URL**
Paste the full device-based or user-based URL that was copied from LunaSea.
**LunaSea Profile**
Enter in the name of the profile which should be an **exact match** to the profile that this module instance was added to within LunaSea. Capitalization and punctuation _does_ matter.
{% hint style="warning" %}
This step is only required if you are _**not**_ using the default LunaSea profile (`default`). LunaSea will assume the default profile when none is supplied.
Correctly setting up this field is critically important to get full deep-linking support.
{% endhint %}
{% endtab %}
{% tab title="Triggers" %}
Select which events should trigger a push notification. The following triggers are supported:
| Trigger | Supported? |
| :--------------------------: | :--------: |
| Playback Start | ✅ |
| Playback Stop | ✅ |
| Playback Pause | ✅ |
| Playback Resume | ✅ |
| Playback Error | ✅ |
| Transcode Decision Change | ✅ |
| Watched | ✅ |
| Buffer Warning | ✅ |
| User Concurrent Streams | ✅ |
| User New Device | ✅ |
| Recently Added | ✅ |
| Plex Server Down | ✅ |
| Plex Server Back Up | ✅ |
| Plex Remote Access Down | ✅ |
| Plex Remote Access Back Up | ✅ |
| Plex Update Available | ✅ |
| Tautulli Update Available | ✅ |
| Tautulli Database Corruption | ✅ |
{% endtab %}
{% tab title="Conditions" %}
You can _**optionally**_ add conditions that must be met for the webhook notifications to trigger.
You can set as many conditions as you like, and can combine different conditions for different triggers by adding separate webhooks to Tautulli.
{% endtab %}
{% tab title="Text" %}
A default message is set for all trigger types, but on this page you can alter the exact text that would appear in the message.
Please read the top of this tab in Tautulli about how to utilize the different modifiers.
{% endtab %}
{% endtabs %}
Once setup, close LunaSea and run the webhook test in Tautulli. You should receive a new notification letting you know that LunaSea is ready to receive Tautulli notifications!
## Attach Images to Notifications
This step is **optional** but recommended. Unlike other modules, in order to receive the actual images (posters, etc.) instead of a generic poster along with the notification, you will need to setup an image host within Tautulli.
1. Go to Tautulli's web GUI
2. Open the Settings, enter "3rd Party APIs"
3. Select any of the available image providers
4. Follow the [3rd Party APIs Guide](https://github.com/Tautulli/Tautulli/wiki/3rd-Party-APIs-Guide) to acquire the required details for the chosen image provider
5. Enter and save the acquired API/Client ID information
{% hint style="info" %}
_If selecting `Self-hosted on public domain` as the image provider, ensure that the image path (_`/tautulli/image`) is publicly accessible from the internet
{% endhint %}

View File

@@ -0,0 +1,31 @@
# Profiles
Do you have multiple instances of modules you want to add to LunaSea? Profiles are the way to do this! LunaSea allows you to have an infinite amount of profiles, each of which can contain a whole new set of configurations for modules.
## Adding, Deleting, and Renaming Profiles
To add, delete, or rename a profile, head to Settings -> Profiles. There are a small collection of simple options on this page, each of which should be self-explanatory.
## Changing Profiles
There are multiple ways to switch profiles within LunaSea.
{% hint style="warning" %}
Switching profiles clears all state-stored data from memory, and all fetched data will be fully refreshed.
{% endhint %}
### Drawer
When you have more than a single profile enabled, the top header of the drawer will show the currently active profile and can be tapped to trigger a dropdown allowing you to select any profile to switch to.
When in a module and you switch to a profile that does not have the module enabled, the only option available on that page will be to return to the dashboard.
### App Bar
When on the home/base route of a module that has another instance enabled in another profile, a dropdown arrow will be displayed beside the module title in the App Bar. Simply tap the module name to get a dropdown list of profiles that have that module enabled.
Any additional profiles that do not have the module enabled will not be shown within the dropdown. If you have additional profiles but no profile has that specific module enabled, the dropdown will not be accessible.
### Settings
You can change your profile within the Settings, either by entering the "Profiles" page and selecting the enabled profile or by entering the "Configuration" page and hitting the profile icon in the App Bar.

View File

@@ -0,0 +1,63 @@
# Lidarr
Adding your Lidarr instance to LunaSea only requires a few steps to get going!
{% hint style="warning" %}
This documentation only covers adding Lidarr to LunaSea via local network (LAN) connections, and does not cover exposing Lidarr externally and connecting remotely.
{% endhint %}
## Preparing Lidarr
### Find Your Local Network IP Address
Finding your local network IP address of the machine running Lidarr is the first step to get setup. To find your local IP address, please look at the following guides:
* [**macOS**](https://osxdaily.com/2010/11/21/find-ip-address-mac/)
* [**Ubuntu**](https://ubuntuhandbook.org/index.php/2020/07/find-ip-address-ubuntu-20-04/)
* [**Windows**](https://support.microsoft.com/en-us/windows/find-your-ip-address-f21a9bbc-c582-55cd-35e0-73431160a1b9)
If you are running a different operating system, you can use any search engine to look up "Find local IP address on \<your operating system>" to typically find tons of guides for any platform.
{% hint style="info" %}
It is recommended to set your host machine's IP address to be statically assigned instead of dynamic/DHCP. This ensures that the IP address will not change through machine or network reboots.
{% endhint %}
### Check What Port is Being Used
If using the default installation, Lidarr runs on port **8686**. In most cases, this port is not changed and does not need to be changed.
The simplest way to check is to go to Lidarr's web GUI, go to Settings -> General and note the value entered into "Port Number".
### Ensure Lidarr is Accessible Across Your Network
To ensure that Lidarr is accessible across your local network, check the following:
* In Lidarr's web GUI, go to Settings -> General and enable advanced settings. Ensure that the "Bind Address" is set to `*`, as this makes Lidarr bind to all network interfaces on the host machine.
* Check any enabled firewalls to confirm that the port running Lidarr is not being blocked.
* **(Windows)**: Ensure that Lidarr has been run as administrator at least once.
### Check If You Are Using a URL Base
In Lidarr's web GUI, go to Settings -> General and check the value of "URL Base". If you have nothing set, you can move on. If you do have a value set, please remember the set value as it will be necessary when setting the host within LunaSea.
## Connecting in LunaSea
### Host
The host is a combination of multiple values found above:
* The local IP address
* The port
* If being used, the URL base
Combine all the values into the following format: `<IP address>:<port>/<URL base>`
For example, if Lidarr is running on port 8686 on a machine that has the IP address 192.168.100.100, the host is: `http://192.168.100.100:8686`.
### API Key
The API key is copied from Lidarr's web GUI, by going to Settings -> General and finding the API key value.
### Custom Headers
Custom headers allows users to attach custom request headers to each API call that is made. This is typically an advanced feature, and is not necessary in most network configurations.

View File

@@ -0,0 +1,55 @@
# Newznab Search
LunaSea supports any indexer that supports the [Newznab API specification](https://newznab.readthedocs.io/en/latest/). Most modern indexers (including NZBHydra2) are fully compliant with this specification, and compatible with LunaSea.
{% hint style="warning" %}
LunaSea supports infinite scrolling of search and category results, which can result in multiple API hits. It is only recommended to add indexers with high API limits to prevent quickly reaching your API limit.
{% endhint %}
## Adding an Indexer
### Display Name
Your personal display name for the indexer. The display name can be anything, but indexers are displayed in **alphabetical order** and the display name you choose will determine where it lands in your list of indexers.
### Indexer API Host
This is the **API host** from the indexer. Do not confused this with the homepage for the indexer! Some indexers use the same URL, but many indexers will use a separate URL (commonly [https://api.indexer.com](https://api.indexer.com)).
If your indexer can and has been added to Lidarr, Radarr, or Sonarr, you can simply copy the URL from the indexer configuration page within their settings.
{% hint style="info" %}
A list of popular indexers and their API hosts is available at the end of this page.
{% endhint %}
### Indexer API Key
Your API key that is typically available in the dashboard of the indexer or received by email when originally signing up for the indexer.
If you are unable to find your API key, consider contacting the administrators of the indexer to get help! The LunaSea developer and community users can try to help, but we cannot guarantee support if nobody has access to said indexer.
### Custom Headers
Custom headers allows users to attach custom request headers to each API call that is made. This is typically an advanced feature, and is not necessary for most public indexers.
## Indexer API Hosts
| Indexer | Host |
| :----------------: | :--------------------------------------------------------------: |
| **DOGnzb** | [https://api.dognzb.cr](https://api.dognzb.cr) |
| **DrunkenSlug** | [https://api.drunkenslug.com](https://api.drunkenslug.com) |
| **NZB.su** | [https://api.nzb.su](https://api.nzb.su) |
| **NZBCat** | [https://nzb.cat](https://nzb.cat) |
| **NZBFinder** | [https://nzbfinder.ws](https://nzbfinder.ws) |
| **NZBGeek** | [https://api.nzbgeek.info](https://api.nzbgeek.info) |
| **NZBPlanet** | [https://api.nzbplanet.net](https://api.nzbplanet.net) |
| **omgwtfnzbs** | [https://api.omgwtfnzbs.me](https://api.omgwtfnzbs.me) |
| **OZnzb** | [https://api.oznzb.com](https://api.oznzb.com) |
| **SimplyNZBs** | [https://simplynzbs.com](https://simplynzbs.com) |
| **Usenet Crawler** | [https://www.usenet-crawler.com](https://www.usenet-crawler.com) |
{% hint style="info" %}
_**Want to add additional indexers?**_
Contact me through GitHub, Discord, or Reddit!
{% endhint %}

View File

@@ -0,0 +1,5 @@
# NZBGet
{% hint style="info" %}
Coming Soon!
{% endhint %}

View File

@@ -0,0 +1,5 @@
# Overseerr
{% hint style="info" %}
Coming Soon!
{% endhint %}

View File

@@ -0,0 +1,63 @@
# Radarr
Adding your Radarr instance to LunaSea only requires a few steps to get going!
{% hint style="warning" %}
This documentation only covers adding Radarr to LunaSea via local network (LAN) connections, and does not cover exposing Radarr externally and connecting remotely.
{% endhint %}
## Preparing Radarr
### Find Your Local Network IP Address
Finding your local network IP address of the machine running Radarr is the first step to get setup. To find your local IP address, please look at the following guides:
* [**macOS**](https://osxdaily.com/2010/11/21/find-ip-address-mac/)
* [**Ubuntu**](https://ubuntuhandbook.org/index.php/2020/07/find-ip-address-ubuntu-20-04/)
* [**Windows**](https://support.microsoft.com/en-us/windows/find-your-ip-address-f21a9bbc-c582-55cd-35e0-73431160a1b9)
If you are running a different operating system, you can use any search engine to look up "Find local IP address on \<your operating system>" to typically find tons of guides for any platform.
{% hint style="info" %}
It is recommended to set your host machine's IP address to be statically assigned instead of dynamic/DHCP. This ensures that the IP address will not change through machine or network reboots.
{% endhint %}
### Check What Port is Being Used
If using the default installation, Radarr runs on port **7878**. In most cases, this port is not changed and does not need to be changed.
The simplest way to check is to go to Radarr's web GUI, go to Settings -> General and note the value entered into "Port Number".
### Ensure Radarr is Accessible Across Your Network
To ensure that Radarr is accessible across your local network, check the following:
* In Radarr's web GUI, go to Settings -> General and enable advanced settings. Ensure that the "Bind Address" is set to `*`, as this makes Radarr bind to all network interfaces on the host machine.
* Check any enabled firewalls to confirm that the port running Radarr is not being blocked.
* **(Windows)**: Ensure that Radarr has been run as administrator at least once.
### Check If You Are Using a URL Base
In Radarr's web GUI, go to Settings -> General and check the value of "URL Base". If you have nothing set, you can move on. If you do have a value set, please remember the set value as it will be necessary when setting the host within LunaSea.
## Connecting in LunaSea
### Host
The host is a combination of multiple values found above:
* The local IP address
* The port
* If being used, the URL base
Combine all the values into the following format: `<IP address>:<port>/<URL base>`
For example, if Radarr is running on port 7878 on a machine that has the IP address 192.168.100.100, the host is: `http://192.168.100.100:7878`.
### API Key
The API key is copied from Radarr's web GUI, by going to Settings -> General and finding the API key value.
### Custom Headers
Custom headers allows users to attach custom request headers to each API call that is made. This is typically an advanced feature, and is not necessary in most network configurations.

View File

@@ -0,0 +1,5 @@
# SABnzbd
{% hint style="info" %}
Coming Soon!
{% endhint %}

View File

@@ -0,0 +1,63 @@
# Sonarr
Adding your Sonarr instance to LunaSea only requires a few steps to get going!
{% hint style="warning" %}
This documentation only covers adding Sonarr to LunaSea via local network (LAN) connections, and does not cover exposing Sonarr externally and connecting remotely.
{% endhint %}
## Preparing Sonarr
### Find Your Local Network IP Address
Finding your local network IP address of the machine running Sonarr is the first step to get setup. To find your local IP address, please look at the following guides:
* [**macOS**](https://osxdaily.com/2010/11/21/find-ip-address-mac/)
* [**Ubuntu**](https://ubuntuhandbook.org/index.php/2020/07/find-ip-address-ubuntu-20-04/)
* [**Windows**](https://support.microsoft.com/en-us/windows/find-your-ip-address-f21a9bbc-c582-55cd-35e0-73431160a1b9)
If you are running a different operating system, you can use any search engine to look up "Find local IP address on \<your operating system>" to typically find tons of guides for any platform.
{% hint style="info" %}
It is recommended to set your host machine's IP address to be statically assigned instead of dynamic/DHCP. This ensures that the IP address will not change through machine or network reboots.
{% endhint %}
### Check What Port is Being Used
If using the default installation, Sonarr runs on port **8989**. In most cases, this port is not changed and does not need to be changed.
The simplest way to check is to go to Sonarr's web GUI, go to Settings -> General and note the value entered into "Port Number".
### Ensure Sonarr is Accessible Across Your Network
To ensure that Sonarr is accessible across your local network, check the following:
* In Sonarr's web GUI, go to Settings -> General and enable advanced settings. Ensure that the "Bind Address" is set to `*`, as this makes Sonarr bind to all network interfaces on the host machine.
* Check any enabled firewalls to confirm that the port running Sonarr is not being blocked.
* **(Windows)**: Ensure that Sonarr has been run as administrator at least once.
### Check If You Are Using a URL Base
In Sonarr's web GUI, go to Settings -> General and check the value of "URL Base". If you have nothing set, you can move on. If you do have a value set, please remember the set value as it will be necessary when setting the host within LunaSea.
## Connecting in LunaSea
### Host
The host is a combination of multiple values found above:
* The local IP address
* The port
* If being used, the URL base
Combine all the values into the following format: `<IP address>:<port>/<URL base>`
For example, if Sonarr is running on port 8989 on a machine that has the IP address 192.168.100.100, the host is: `http://192.168.100.100:8989`.
### API Key
The API key is copied from Sonarr's web GUI, by going to Settings -> General and finding the API key value.
### Custom Headers
Custom headers allows users to attach custom request headers to each API call that is made. This is typically an advanced feature, and is not necessary in most network configurations.

View File

@@ -0,0 +1,5 @@
# Tautulli
{% hint style="info" %}
Coming Soon!
{% endhint %}

View File

@@ -0,0 +1,5 @@
# Wake on LAN
{% hint style="info" %}
Coming Soon!
{% endhint %}

View File

@@ -0,0 +1,48 @@
# Android
LunaSea is available on Android 7.0+.
Note that Google Play Services are not required for core functionality, however LunaSea account features and push notifications are not supported at this time without Google Play Services.
{% hint style="info" %}
If you want a stable experience, stick with stable releases. Want to test new builds of LunaSea? Read about the [build channels](../getting-started/build-channels.md) to make the right choice!
{% endhint %}
## Google Play Store
_Channel(s): `Stable`, `Beta`, `Edge`_
The easiest way for most users with Android devices would be to download releases of LunaSea directly from the [Google Play Store](https://www.lunasea.app/playstore)!
{% tabs %}
{% tab title="Stable" %}
Head to the [Google Play Store](https://www.lunasea.app/playstore)!
{% endtab %}
{% tab title="Beta" %}
1. Head to the [Google Play Store](https://www.lunasea.app/playstore)
2. Register for the test directly on the store listing
3. Download LunaSea via the Google Play Store
{% endtab %}
{% tab title="Edge" %}
1. Join the [LunaSea: Edge Testing](https://groups.google.com/g/lunasea-edge-test) Google Group
2. Head to the [Google Play Store](https://www.lunasea.app/playstore)
3. Register for the test directly on the store listing
4. Download LunaSea via the Google Play Store
{% endtab %}
{% endtabs %}
## Build Bucket
_Channel(s): `Stable`, `Beta`, `Edge`_\
_Format(s): `.apk`_
All Android releases are available in the [Build Bucket](https://builds.lunasea.app/#latest/)!
## GitHub Releases
_Channel(s): `Stable`_\
_Format(s): `.apk`_
All stable releases are available on GitHub via the [Releases](https://github.com/JagandeepBrar/LunaSea/releases) page!

View File

@@ -0,0 +1,55 @@
# iOS
LunaSea is available on iOS 11.0+.
Note that installation of iOS app package (`.ipa`) files is a relatively advanced task and instructions are outside the scope of LunaSea's documentation and no support will be provided.
{% hint style="info" %}
If you want a stable experience, stick with stable releases. Want to test new builds of LunaSea? Read about the [build channels](../getting-started/build-channels.md) to make the right choice!
{% endhint %}
## App Store
_Channel(s): `Stable`_
The easiest way for most users with iOS devices who want stable releases would be to download releases of LunaSea directly from the [App Store](https://www.lunasea.app/appstore)!
## TestFlight
_Channel(s): `Stable`, `Beta`, `Edge`_
The easiest way for most users with iOS devices to use test channels is using the [TestFlight](https://apps.apple.com/app/testflight/id899247664) platform!
{% tabs %}
{% tab title="Stable" %}
1. [Download TestFlight for iOS](https://apps.apple.com/app/testflight/id899247664)
2. Join the [TestFlight stable channel](https://www.lunasea.app/testflight/stable)
3. Download LunaSea via the TestFlight application
{% endtab %}
{% tab title="Beta" %}
1. [Download TestFlight for iOS](https://apps.apple.com/app/testflight/id899247664)
2. Join the [TestFlight beta channel](https://www.lunasea.app/testflight/beta)
3. Download LunaSea via the TestFlight application
{% endtab %}
{% tab title="Edge" %}
1. [Download TestFlight for iOS](https://apps.apple.com/app/testflight/id899247664)
2. Join the [TestFlight edge channel](https://www.lunasea.app/testflight/edge)
3. Download LunaSea via the TestFlight application
{% endtab %}
{% endtabs %}
## Build Bucket
_Channel(s): `Stable`, `Beta`, `Edge`_\
_Format(s): `.ipa`_
All iOS releases are available in the [Build Bucket](https://builds.lunasea.app/#latest/)!
## GitHub Releases
_Channel(s): `Stable`_\
_Format(s): `.ipa`_
All stable releases are available on GitHub via the [Releases](https://github.com/JagandeepBrar/LunaSea/releases) page!

View File

@@ -0,0 +1,48 @@
# Linux
LunaSea is available on all graphical Linux distributions that have `snap` installed and configured or are capable of installing a Debian distribution (`.deb`).
{% hint style="info" %}
If you want a stable experience, stick with stable releases. Want to test new builds of LunaSea? Read about the [build channels](../getting-started/build-channels.md) to make the right choice!
{% endhint %}
## Snapcraft
_Channel(s): `Stable`, `Beta`, `Edge`_
The easiest way for most users on graphic Linux distributions would be to download releases of LunaSea directly from [Snapcraft](https://www.lunasea.app/snapcraft)!
{% tabs %}
{% tab title="Stable" %}
```
sudo snap install lunasea
```
{% endtab %}
{% tab title="Beta" %}
```
sudo snap install lunasea --beta
```
{% endtab %}
{% tab title="Edge" %}
```
sudo snap install lunasea --edge
```
{% endtab %}
{% endtabs %}
## Build Bucket
_Channel(s): `Stable`, `Beta`, `Edge`_\
_Format(s): `.snap`, `.deb`, `.tar.gz`_
All Linux releases are available in the [Build Bucket](https://builds.lunasea.app/#latest/)!
## GitHub Releases
_Channel(s): `Stable`_\
_Format(s): `.snap`, `.deb`, `.tar.gz`_
All stable releases are available on GitHub via the [Releases](https://github.com/JagandeepBrar/LunaSea/releases) page!

View File

@@ -0,0 +1,54 @@
# macOS
LunaSea is available on macOS 10.15+.
{% hint style="info" %}
If you want a stable experience, stick with stable releases. Want to test new builds of LunaSea? Read about the [build channels](https://docs.lunasea.app/getting-started/build-channels) to make the right choice!
{% endhint %}
## TestFlight
_Channel(s): `Stable`, `Beta`, `Edge`_
The easiest way for most users with macOS devices would be to download releases of LunaSea using the [TestFlight](https://apps.apple.com/app/testflight/id899247664) platform!
{% tabs %}
{% tab title="Stable" %}
1. [Download TestFlight for macOS](https://apps.apple.com/app/testflight/id899247664)
2. Join the [TestFlight stable channel](https://www.lunasea.app/testflight/stable)
3. Download LunaSea via the TestFlight application
{% endtab %}
{% tab title="Beta" %}
1. [Download TestFlight for macOS](https://apps.apple.com/app/testflight/id899247664)
2. Join the [TestFlight beta channel](https://www.lunasea.app/testflight/beta)
3. Download LunaSea via the TestFlight application
{% endtab %}
{% tab title="Edge" %}
1. [Download TestFlight for macOS](https://apps.apple.com/app/testflight/id899247664)
2. Join the [TestFlight edge channel](https://www.lunasea.app/testflight/edge)
3. Download LunaSea via the TestFlight application
{% endtab %}
{% endtabs %}
## Build Bucket
_Channel(s): `Stable`, `Beta`, `Edge`_\
_Format(s): `.dmg`, `.zip`_
All macOS releases are available in the [Build Bucket](https://builds.lunasea.app/#latest/)!
## Homebrew Cask
_Channel(s): `Stable`_
All stable releases are available via [Homebrew Cask](https://formulae.brew.sh/cask/lunasea)!
## GitHub Releases
_Channel(s): `Stable`_\
_Format(s): `.dmg`, `.zip`_
All stable releases are available on GitHub via the [Releases](https://github.com/JagandeepBrar/LunaSea/releases) page!

View File

@@ -0,0 +1,67 @@
# Web
LunaSea can be hosted as a web application for usage within any modern browser!
{% hint style="info" %}
If you want a stable experience, stick with stable releases. Want to test new builds of LunaSea? Read about the [build channels](https://docs.lunasea.app/getting-started/build-channels) to make the right choice!
{% endhint %}
## Hosted Builds
_Channel(s): `Stable`, `Beta`, `Edge`_
All web releases of LunaSea are available on hosted instances by the LunaSea team! All communication and data stored is client-side, but there are some limitations of the platform which can be [viewed here](https://docs.lunasea.app/getting-started/platform-restrictions).
{% tabs %}
{% tab title="Stable" %}
Access the stable release [here](https://web.lunasea.app/)!
{% endtab %}
{% tab title="Beta" %}
Access the beta release [here](https://beta.web.lunasea.app/)!
{% endtab %}
{% tab title="Edge" %}
Access the edge release [here](https://edge.web.lunasea.app/)!
{% endtab %}
{% endtabs %}
## Docker
_Channel(s): `Stable`, `Beta`, `Edge`_
All web releases of LunaSea are also available in officially hosted Docker images! There is currently only one value that needs to be configured which is the port mapping. LunaSea functions as a frontend application with all data being stored client-side.
{% tabs %}
{% tab title="Stable" %}
```
docker run -p 80:80 ghcr.io/jagandeepbrar/lunasea:stable
```
{% endtab %}
{% tab title="Beta" %}
```
docker run -p 80:80 ghcr.io/jagandeepbrar/lunasea:beta
```
{% endtab %}
{% tab title="Edge" %}
```
docker run -p 80:80 ghcr.io/jagandeepbrar/lunasea:edge
```
{% endtab %}
{% endtabs %}
## Build Bucket
_Channel(s): `Stable`, `Beta`, `Edge`_\
_Format(s): `.zip`_
All web releases are available in the [Build Bucket](https://builds.lunasea.app/#latest/)!
## GitHub Releases
_Channel(s): `Stable`_\
_Format(s): `.zip`_
All stable releases are available on GitHub via the [Releases](https://github.com/JagandeepBrar/LunaSea/releases) page!

View File

@@ -0,0 +1,21 @@
# Windows
LunaSea is available on Windows 10+.
{% hint style="info" %}
If you want a stable experience, stick with stable releases. Want to test new builds of LunaSea? Read about the [build channels](https://docs.lunasea.app/getting-started/build-channels) to make the right choice!
{% endhint %}
## Build Bucket
_Channel(s): `Stable`, `Beta`, `Edge`_\
_Format(s): `.msix`, `.zip`_
All Windows releases are available in the [Build Bucket](https://builds.lunasea.app/#latest/)!
## GitHub Releases
_Channel(s): `Stable`_\
_Format(s): `.msix`, `.zip`_
All stable releases are available on GitHub via the [Releases](https://github.com/JagandeepBrar/LunaSea/releases) page!

View File

@@ -0,0 +1,17 @@
data/
node_modules/
.dockerignore
.env
.env.sample
.eslintignore
.eslintrc.json
.gitignore
.prettierignore
.prettierrc.json
Dockerfile
LICENSE
nodemon.json
npm-debug.log
README.md
server.log
serviceaccount.json

View File

@@ -0,0 +1,11 @@
FIREBASE_CLIENT_EMAIL=
FIREBASE_DATABASE_URL=
FIREBASE_PRIVATE_KEY=
FIREBASE_PROJECT_ID=
FANART_TV_API_KEY=
THEMOVIEDB_API_KEY=
REDIS_USE_TLS="false"
REDIS_HOST=
REDIS_PORT="6379"
REDIS_USER="default"
REDIS_PASS=""

View File

@@ -0,0 +1,8 @@
dist/**
node_modules/**
.eslintrc.json
.prettierrc.json
nodemon.json
package-lock.json
package.json
tsconfig.json

View File

@@ -0,0 +1,17 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"no-inner-declarations": "off"
}
}

View File

@@ -0,0 +1,36 @@
name: Build and Push to GitHub Registry
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Login to GitHub Package Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Get current package version
uses: martinbeentjes/npm-get-version-action@v1.1.0
id: package
- name: Build and Push Docker Image
uses: docker/build-push-action@v2
with:
push: true
context: .
tags: |
ghcr.io/jagandeepbrar/lunasea-notification-service:latest
ghcr.io/jagandeepbrar/lunasea-notification-service:${{ steps.package.outputs.current-version}}

120
lunasea-notification-service/.gitignore vendored Normal file
View File

@@ -0,0 +1,120 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.env
serviceaccount.json
server.log

View File

@@ -0,0 +1 @@
_

View File

@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no-install pretty-quick --staged

View File

@@ -0,0 +1 @@
message="chore(release): v%s"

View File

@@ -0,0 +1,3 @@
dist/**
node_modules/**
package-lock.json

View File

@@ -0,0 +1,10 @@
{
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"bracketSpacing": true,
"arrowParens": "always",
"endOfLine": "lf",
"printWidth": 100
}

View File

@@ -0,0 +1,5 @@
{
"yaml.schemas": {
"https://json.schemastore.org/github-workflow.json": "file:///Users/jagandeepbrar/Git/LunaSea-Notification-Service/.github/workflows/build.yaml"
}
}

View File

@@ -0,0 +1,15 @@
FROM node:18-alpine
LABEL org.opencontainers.image.source="https://github.com/JagandeepBrar/LunaSea-Notification-Service"
# Install packages, copy data, build project
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
RUN npm prune --production
# Add Tini
RUN apk add --no-cache tini
ENTRYPOINT ["/sbin/tini", "--"]
# Start the docker version, expose port 9000
CMD ["npm", "run", "docker"]
EXPOSE 9000

View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@@ -0,0 +1,68 @@
# LunaSea Notification Service
A TypeScript backend service that handles receiving webhooks from applications supported in [LunaSea](https://www.lunasea.app/github) and sends notifications to the respective user or device.
> Setting up an instance of your own notification service is **not** necessary to get webhook notifications in LunaSea, simply use the hosted notification service available at [https://notify.lunasea.app](https://notify.lunasea.app). Setting up your own instance _will not_ send notifications to the officially published LunaSea application.
>
> Setting up your own instance of the notification service is only necessary when building your own version of LunaSea, which utilizes a different Firebase project.
## Usage
For documentation on setting up the webhooks, please look at LunaSea's documentation [available here](https://notify.lunasea.app).
## Installation (Docker)
```docker
docker run -d \
-e FIREBASE_CLIENT_EMAIL=firebase-adminsdk-example@project.iam.gserviceaccount.com \
-e FIREBASE_DATABASE_URL=https://example-project.firebaseio.com \
-e FIREBASE_PRIVATE_KEY=example-private-key \
-e FIREBASE_PROJECT_ID=example-project \
-e FANART_TV_API_KEY=1234567890 \
-e THEMOVIEDB_API_KEY=1234567890 \
-e REDIS_HOST=192.168.1.100
-e REDIS_PORT=6379
-p 9000:9000 \
--restart unless-stopped \
ghcr.io/jagandeepbrar/lunasea-notification-service:latest
```
## Development & Installation
LunaSea's Notification Service requires:
- Node.js v10.0.0 or higher (v14.0.0 or higher is recommended)
- Redis 6
- A Firebase Project
### Environment
All environment variables must either be set at an operating system-level, terminal-level, as Docker environment variables, or by creating a `.env` file at the root of the project. A sample `.env` is supplied in the project (`.env.sample`).
| Variable | Value | Default | Required? |
| :---------------------- | :-------------------------------------------------------------------- | :-----: | :-------: |
| `FIREBASE_CLIENT_EMAIL` | The Firebase client email for the project. | &mdash; | &check; |
| `FIREBASE_DATABASE_URL` | The Firebase database URL for the project. | &mdash; | &check; |
| `FIREBASE_PRIVATE_KEY` | The Firebase private key for the project. | &mdash; | &check; |
| `FIREBASE_PROJECT_ID` | The Firebase project ID for the project. | &mdash; | &check; |
| `FANART_TV_API_KEY` | A developer [Fanart.tv](https://fanart.tv/) API key. | &mdash; | &check; |
| `THEMOVIEDB_API_KEY` | A developer [The Movie Database](https://www.themoviedb.org) API key. | &mdash; | &check; |
| `REDIS_HOST` | Redis instance hostname. | &mdash; | &check; |
| `REDIS_PORT` | Redis instance port. | &mdash; | &check; |
| `REDIS_USER` | Redis instance username. | `""` | &cross; |
| `REDIS_PASS` | Redis instance password. | `""` | &cross; |
| `REDIS_USE_TLS` | Use a TLS connection when communicating with Redis? | `false` | &cross; |
| `PORT` | The port to attach the service web server to. | `9000` | &cross; |
### Running
2. Configure the required environmental variables
3. Run `npm install`
4. Run `npm start`
### Building
2. Configure the required environmental variables
3. Run `npm install`
4. Run `npm run build`
5. Run `npm run serve`

View File

@@ -0,0 +1,10 @@
{
"restartable": "rs",
"ignore": [".git", "node_modules", "dist"],
"watch": ["src"],
"exec": "ts-node -r dotenv/config",
"env": {
"NODE_ENV": "development"
},
"ext": "js,json,ts"
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,48 @@
{
"name": "lunasea-notification-service",
"version": "1.5.5",
"description": "Notification service for LunaSea",
"repository": "https://github.com/JagandeepBrar/LunaSea-Notification-Service",
"main": "index.js",
"scripts": {
"start": "cross-env NODE_ENV=development nodemon --config nodemon.json src/index.ts",
"start:dev": "cross-env NODE_ENV=development nodemon --config nodemon.json src/index.ts | pino-pretty -c -t -l",
"build": "tsc",
"serve": "cross-env NODE_ENV=production ts-node -r dotenv/config dist/index.js",
"publish": "npm run docker:build && npm run docker:push",
"docker": "ts-node -r dotenv/config dist/index.js",
"lint": "eslint . --ext .ts",
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",
"prepare": "husky install"
},
"author": "Jagandeep Brar",
"license": "GPL-3.0-only",
"dependencies": {
"@types/basic-auth": "^1.1.4",
"@types/express": "^4.17.18",
"@types/ioredis": "^4.28.10",
"@types/node": "^20.8.2",
"axios": "^1.5.1",
"basic-auth": "^2.0.1",
"cross-env": "^7.0.3",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"firebase-admin": "^11.11.0",
"ioredis": "^5.3.2",
"node-typescript-compiler": "3.0.0",
"pino": "^8.15.4",
"ts-node": "^10.9.1",
"tslog": "^4.9.2",
"typescript": "^5.2.2"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"eslint": "^8.50.0",
"husky": "^8.0.3",
"nodemon": "^3.0.1",
"pino-pretty": "^10.2.2",
"prettier": "2.5.1",
"pretty-quick": "^3.1.3"
}
}

View File

@@ -0,0 +1,57 @@
import axios from 'axios';
import { Logger, Environment } from '../../utils';
const logger = Logger.child({ module: 'fanart_tv' });
const http = axios.create({
baseURL: 'http://webservice.fanart.tv/v3/',
params: {
api_key: Environment.FANART_TV_API_KEY.read(),
},
});
const convertToPreview = (url: string): string => url.replace('/fanart/', '/preview/');
export const getArtistThumbnail = async (artistId: string): Promise<string | undefined> => {
try {
return await http({
method: 'GET',
url: `music/${artistId}`,
}).then((response) => {
if (
response.data.artistthumb &&
Array.isArray(response.data.artistthumb) &&
response.data.artistthumb.length > 0
) {
const url = convertToPreview(response.data.artistthumb[0]?.url);
if (url) return url;
}
});
} catch (error) {
logger.error(error);
}
return undefined;
};
export const getAlbumCover = async (albumId: string): Promise<string | undefined> => {
try {
return await http({
method: 'GET',
url: `music/albums/${albumId}`,
}).then((response) => {
if (
response.data.albums &&
response.data.albums[albumId] &&
response.data.albums[albumId].albumcover &&
Array.isArray(response.data.albums[albumId].albumcover) &&
response.data.albums[albumId].albumcover.length > 0
) {
const url = convertToPreview(response.data[albumId].albumcover[0]?.url);
if (url) return url;
}
});
} catch (error) {
logger.error(error);
}
return undefined;
};

View File

@@ -0,0 +1,3 @@
import * as FanartTV from './fanart_tv';
import * as TheMovieDB from './the_movie_db';
export { FanartTV, TheMovieDB };

View File

@@ -0,0 +1,39 @@
import axios from 'axios';
import { ContentResponse, ExternalSourceType, FindContentResponse } from './models';
import { Constants, Environment } from '../../utils';
const http = axios.create({
method: 'GET',
baseURL: Constants.THE_MOVIE_DB.API.BASE_URL,
params: {
api_key: Environment.THEMOVIEDB_API_KEY.read(),
},
});
export const getMoviePoster = async (movieId: number): Promise<string | undefined> => {
return http({
url: `movie/${movieId}`,
}).then((response): string | undefined => {
const movie = response.data as ContentResponse;
if (movie.poster_path) return movie.poster_path;
if (movie.backdrop_path) return movie.backdrop_path;
return undefined;
});
};
export const getSeriesPoster = async (seriesId: number): Promise<string | undefined> => {
return await http({
url: `find/${seriesId}`,
params: {
external_source: ExternalSourceType.tvdbId,
},
}).then((response): string | undefined => {
const data = response.data as FindContentResponse;
if (data.tv_results && data.tv_results.length > 0) {
const series = data.tv_results[0];
if (series.poster_path) return series.poster_path;
if (series.backdrop_path) return series.backdrop_path;
return undefined;
}
});
};

View File

@@ -0,0 +1,37 @@
import { Redis } from '../../services';
import { Constants } from '../../utils';
const _keyBuilderSeries = (seriesId: number): string => {
return `${Constants.REDIS.PREFIX.IMAGE_CACHE}:THE_MOVIE_DB:SERIES:${seriesId}`;
};
const _keyBuilderMovie = (movieId: number): string => {
return `${Constants.REDIS.PREFIX.IMAGE_CACHE}:THE_MOVIE_DB:MOVIES:${movieId}`;
};
export const getMoviePoster = async (movieId: number): Promise<string | undefined> => {
const key = _keyBuilderMovie(movieId);
const res = await Redis.get(key);
if (res) return res;
return undefined;
};
export const setMoviePoster = async (movieId: number, url: string): Promise<boolean> => {
const key = _keyBuilderMovie(movieId);
const res = await Redis.set(key, url, Constants.REDIS.EXPIRE.IMAGE_CACHE);
if (res) return true;
return false;
};
export const getSeriesPoster = async (seriesId: number): Promise<string | undefined> => {
const key = _keyBuilderSeries(seriesId);
const res = await Redis.get(key);
if (res) return res;
return undefined;
};
export const setSeriesPoster = async (seriesId: number, url: string): Promise<boolean> => {
const key = _keyBuilderSeries(seriesId);
const res = await Redis.set(key, url, Constants.REDIS.EXPIRE.IMAGE_CACHE);
if (res) return true;
return false;
};

View File

@@ -0,0 +1,45 @@
import { Constants, Logger } from '../../utils';
import * as API from './api';
import * as Cache from './cache';
const logger = Logger.child({ module: 'the_movie_db' });
const _constructImageURL = (path: string): string => {
return `${Constants.THE_MOVIE_DB.IMAGE.BASE_URL}${Constants.THE_MOVIE_DB.IMAGE.SIZE}${path}`;
};
export const getMoviePoster = async (movieId: number): Promise<string | undefined> => {
try {
// Cache
const cache = await Cache.getMoviePoster(movieId);
if (cache) return _constructImageURL(cache);
// API
const api = await API.getMoviePoster(movieId);
if (api) {
Cache.setMoviePoster(movieId, api);
return _constructImageURL(api);
}
} catch (error) {
logger.error(error);
}
return undefined;
};
export const getSeriesPoster = async (seriesId: number): Promise<string | undefined> => {
try {
// Cache
const cache = await Cache.getSeriesPoster(seriesId);
if (cache) return _constructImageURL(cache);
// API
const api = await API.getSeriesPoster(seriesId);
if (api) {
Cache.setSeriesPoster(seriesId, api);
return _constructImageURL(api);
}
} catch (error) {
logger.error(error);
}
return undefined;
};

View File

@@ -0,0 +1,23 @@
export enum ExternalSourceType {
facebookId = 'facebook_id',
freebaseId = 'freebase_id',
freebaseMid = 'freebase_mid',
imdbId = 'imdb_id',
instagramId = 'instagram_id',
tvdbId = 'tvdb_id',
tvRageId = 'tvrage_id',
twitterId = 'twitter_id',
}
export interface ContentResponse {
backdrop_path?: string;
poster_path?: string;
}
export interface FindContentResponse {
movie_results: ContentResponse[];
person_results: ContentResponse[];
tv_results: ContentResponse[];
tv_episode_results: ContentResponse[];
tv_season_results: ContentResponse[];
}

View File

@@ -0,0 +1,6 @@
import { Server } from './server';
import { Firebase, Redis } from './services';
Firebase.initialize();
Redis.initialize();
Server.start();

View File

@@ -0,0 +1,48 @@
import express from 'express';
import { Middleware, Models as ServerModels } from '../../server';
import { Firebase } from '../../services';
import { Constants, Logger, Notifications } from '../../utils';
export const enable = (api: express.Router) => api.use(route, router);
const logger = Logger.child({ module: 'custom' });
const router = express.Router();
const route = '/custom';
router.post(
'/user/:id',
Middleware.validateUser,
Middleware.checkNotificationPassword,
Middleware.pullUserTokens,
handler,
);
router.post('/device/:id', Middleware.extractDeviceToken, handler);
async function handler(request: express.Request, response: express.Response): Promise<void> {
try {
response.status(200).json(<ServerModels.Response>{ message: Constants.MESSAGE.OK });
await _handleWebhook(
request.body,
response.locals.tokens,
response.locals.notificationSettings,
);
} catch (error) {
logger.error(error);
response
.status(500)
.json(<ServerModels.Response>{ message: Constants.MESSAGE.INTERNAL_SERVER_ERROR });
}
}
const _handleWebhook = async (
data: any,
devices: string[],
settings: Notifications.Settings,
): Promise<void> => {
const payload = <Notifications.Payload>{
title: data?.title ?? 'Unknown Title',
body: data?.body ?? 'Unknown Content',
image: data?.image,
};
await Firebase.sendNotification(devices, payload, settings);
};

View File

@@ -0,0 +1,2 @@
import * as Controller from './controller';
export { Controller };

View File

@@ -0,0 +1,23 @@
import express from 'express';
import * as Middleware from '../server/middleware';
import { Controller as Custom } from './custom';
import { Controller as Lidarr } from './lidarr';
import { Controller as Overseerr } from './overseerr';
import { Controller as Radarr } from './radarr';
import { Controller as Sonarr } from './sonarr';
import { Controller as Tautulli } from './tautulli';
export const router = express.Router();
// Shared Middleware
router.use(Middleware.startNewRequest);
router.use(Middleware.extractNotificationOptions);
router.use(Middleware.extractProfile);
// Modules
Custom.enable(router);
Lidarr.enable(router);
Overseerr.enable(router);
Radarr.enable(router);
Sonarr.enable(router);
Tautulli.enable(router);

View File

@@ -0,0 +1,69 @@
import express from 'express';
import { Models, Payloads } from './';
import { Middleware, Models as ServerModels } from '../../server';
import { Firebase } from '../../services';
import { Constants, Logger, Notifications } from '../../utils';
export const enable = (api: express.Router) => api.use(route, router);
const logger = Logger.child({ module: 'lidarr' });
const router = express.Router();
const route = '/lidarr';
router.post(
'/user/:id',
Middleware.validateUser,
Middleware.checkNotificationPassword,
Middleware.pullUserTokens,
handler,
);
router.post('/device/:id', Middleware.extractDeviceToken, handler);
async function handler(request: express.Request, response: express.Response): Promise<void> {
try {
response.status(200).json(<ServerModels.Response>{ message: Constants.MESSAGE.OK });
await _handleWebhook(
request.body,
response.locals.tokens,
response.locals.profile,
response.locals.notificationSettings,
);
} catch (error) {
logger.error(error);
response
.status(500)
.json(<ServerModels.Response>{ message: Constants.MESSAGE.INTERNAL_SERVER_ERROR });
}
}
const _handleWebhook = async (
data: any,
devices: string[],
profile: string,
settings: Notifications.Settings,
): Promise<void> => {
let payload: Notifications.Payload | undefined;
if (data.eventType) {
switch (data.eventType) {
case Models.EventType.Download:
payload = await Payloads.download(data, profile);
break;
case Models.EventType.Grab:
payload = await Payloads.grab(data, profile);
break;
case Models.EventType.Rename:
payload = await Payloads.rename(data, profile);
break;
case Models.EventType.Retag:
payload = await Payloads.retag(data, profile);
break;
case Models.EventType.Test:
payload = await Payloads.test(data, profile);
break;
default:
logger.warn({ data }, '-> An unknown EventType was received');
break;
}
}
if (payload) await Firebase.sendNotification(devices, payload, settings);
};

View File

@@ -0,0 +1,4 @@
import * as Controller from './controller';
import * as Models from './models';
import * as Payloads from './payloads';
export { Controller, Models, Payloads };

View File

@@ -0,0 +1,77 @@
export enum EventType {
Test = 'Test',
Grab = 'Grab',
Rename = 'Rename',
Retag = 'Retag',
Download = 'Download',
}
export interface ArtistProperties {
id?: number;
name?: string;
path?: string;
mbId?: string;
}
export interface AlbumProperties {
id?: number;
title?: string;
quality?: string;
qualityVersion?: number;
releaseDate?: string;
}
export interface TrackProperties {
id?: number;
title?: string;
trackNumber?: string;
quality?: string;
qualityVersion?: number;
}
export interface TrackFileProperties {
id?: number;
path?: string;
quality?: string;
qualityVersion?: number;
sceneName?: string;
}
export interface ReleaseProperties {
quality?: string;
qualityVersion?: number;
releaseTitle?: string;
indexer?: string;
size?: number;
}
export interface TestEventType {
eventType?: EventType;
artist?: ArtistProperties;
albums?: AlbumProperties[];
}
export interface GrabEventType {
eventType?: EventType;
artist?: ArtistProperties;
albums?: AlbumProperties[];
release?: ReleaseProperties;
}
export interface RenameEventType {
eventType?: EventType;
artist?: ArtistProperties;
}
export interface RetagEventType {
eventType?: EventType;
artist?: ArtistProperties;
}
export interface DownloadEventType {
eventType?: EventType;
artist?: ArtistProperties;
tracks?: TrackProperties[];
trackFiles?: TrackFileProperties[];
isUpgrade?: boolean;
}

Some files were not shown because too many files have changed in this diff Show More