Skip to content

Commit

Permalink
Add all basic configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
BusterNeece committed Jan 6, 2024
1 parent 60aed86 commit 0c86ea5
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 12 deletions.
55 changes: 52 additions & 3 deletions templates/azuracast/index.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,74 @@
import { Output, Services } from "~templates-utils";
import { Output, Services, randomPassword } from "~templates-utils";
import { Input } from "./meta";

export function generate(input: Input): Output {
const services: Services = [];

const protectedPorts = [
3306, // MariaDB
6010, // Nginx internal
6379, // Redis
8080, // Common debug port
80, // HTTP
443, // HTTPS
2022, // SFTP
];

const ports = [
{
published: input.appSftpPort,
target: input.appSftpPort
}
];

for(let i = input.appMinimumStationPort; i < input.appMaximumStationPort; i += 10) {
if (protectedPorts.includes(i)) {
continue;
}

ports.push({
published: i,
target: i
});
ports.push({
published: i+5,
target: i+5
});
ports.push({
published: i+6,
target: i+6
});
}

const databasePassword = randomPassword();

services.push({
type: "app",
data: {
projectName: input.projectName,
serviceName: input.appServiceName,
env: [
`AZURACAST_HTTP_PORT=${input.appHttpPort}`,
`AZURACAST_HTTPS_PORT=${input.appHttpsPort}`,
`AZURACAST_SFTP_PORT=${input.appSftpPort}`,
`MYSQL_ROOT_PASSWORD=${databasePassword}`,
`AUTO_ASSIGN_PORT_MIN=${input.appMinimumStationPort}`,
`AUTO_ASSIGN_PORT_MAX=${input.appMaximumStationPort}`
].join("\n"),
source: { type: "image", image: "ghcr.io/azuracast/azuracast:"+input.appServiceVersion },
domains: [
{
host: "$(EASYPANEL_DOMAIN)",
port: 80,
port: input.appHttpPort,
https: false
},
{
host: "$(EASYPANEL_DOMAIN)",
port: 443,
port: input.appHttpsPort,
https: true
},
],
ports: ports,
mounts: [
{
type: "volume",
Expand Down
43 changes: 34 additions & 9 deletions templates/azuracast/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: AzuraCast is a self-hosted, all-in-one web radio management suite.
affordable VPS web hosts.
instructions: Once installation is complete, you must complete setup by visiting the new installation
in your browser. Some credentials (like the MySQL root password) are automatically generated upon
installation; you can access them in `.env` on the host filesystem if needed.
installation you can access them by viewing the app configuration on the host machine.
changeLog:
- date: 2024-01-05
description: Template created (v0.19.4)
Expand All @@ -25,6 +25,11 @@ schema:
- projectName
- appServiceName
- appServiceVersion
- appHttpPort
- appHttpsPort
- appSftpPort
- appMinimumStationPort
- appMaximumStationPort
properties:
projectName:
type: string
Expand All @@ -37,27 +42,47 @@ schema:
type: string
title: Release Channel ("stable", "rolling", or a specific version)
default: stable
appHttpPort:
type: number
title: HTTP Port
default: 80
appHttpsPort:
type: number
title: HTTPS Port
default: 443
appSftpPort:
type: number
title: SFTP Port
default: 2022
appMinimumStationPort:
type: number
title: Station Auto-assigned Port Range Minimum
default: 8000
appMaximumStationPort:
type: number
title: Station Auto-assigned Port Range Maximum
default: 8500
benefits:
- title: Everything's Included
description: AzuraCast installs everything you need to get a web radio station
up and running in minutes.
up and running in minutes.
- title: Powerful and Intuitive
description: Manage every aspect of your radio station via a simple yet
powerful web interface.
powerful web interface.
- title: Runs Anywhere
description: Install AzuraCast onto any server (or desktop) that supports Docker.
features:
- title: Web-Based Station Management
description: Upload media, manage playlists, create local mount points and remote
relays, view analytics and reports and much more, all from the convenience of
your web browser.
relays, view analytics and reports and much more, all from the convenience of
your web browser.
- title: Multi-Station Administration
description: Host multiple stations on a single installation, create new user
accounts and unique roles with granular permissions. Back up your installation
and keep track of every station from one central location.
accounts and unique roles with granular permissions. Back up your installation
and keep track of every station from one central location.
- title: Built-in Public Pages
description: Out of the box, each station includes a public-facing player page
that can also be embedded into your own web site. Our powerful APIs let you build
your own players and interfaces that take advantage of our rich metadata support.
that can also be embedded into your own web site. Our powerful APIs let you build
your own players and interfaces that take advantage of our rich metadata support.
tags:
- Media

0 comments on commit 0c86ea5

Please sign in to comment.