feat(readme-generator): move the readme file outside of the script an… (#2271)
* feat(readme-generator): move the readme file outside of the script and ignore deprecated apps * refactor(readme-generator): create a readme template
This commit is contained in:
parent
d350914d45
commit
6dc8280887
68
.github/scripts/readme-generator.ts
vendored
Normal file
68
.github/scripts/readme-generator.ts
vendored
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
import fs from "fs";
|
||||||
|
|
||||||
|
type App = {
|
||||||
|
name: string;
|
||||||
|
description: string;
|
||||||
|
link: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
const getAppsList = async () => {
|
||||||
|
const apps: Record<string, App> = {};
|
||||||
|
// fetch apps from app store repo
|
||||||
|
const res = await fetch(
|
||||||
|
"https://api.github.com/repos/runtipi/runtipi-appstore/contents/apps"
|
||||||
|
);
|
||||||
|
|
||||||
|
const data = await res.json();
|
||||||
|
const appNames = data.map((app) => app.name);
|
||||||
|
|
||||||
|
for (const app of appNames) {
|
||||||
|
const config = await fetch(
|
||||||
|
`https://raw.githubusercontent.com/runtipi/runtipi-appstore/master/apps/${app}/config.json`
|
||||||
|
);
|
||||||
|
const appConfig = await config.text();
|
||||||
|
try {
|
||||||
|
const appConfigJson = JSON.parse(appConfig);
|
||||||
|
|
||||||
|
if (!appConfigJson.deprecated) {
|
||||||
|
apps[app] = {
|
||||||
|
name: appConfigJson.name,
|
||||||
|
description: appConfigJson.short_desc,
|
||||||
|
link: appConfigJson.source,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error(`Error parsing config for ${app}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return { apps };
|
||||||
|
};
|
||||||
|
|
||||||
|
const appToReadme = async (app) => {
|
||||||
|
return `- [${app.name}](${app.link}) - ${app.description}`;
|
||||||
|
};
|
||||||
|
|
||||||
|
const writeToReadme = (appsList) => {
|
||||||
|
const baseReadme = fs.readFileSync(
|
||||||
|
__dirname + "/../../templates/README.md",
|
||||||
|
"utf8"
|
||||||
|
);
|
||||||
|
const finalReadme = baseReadme.replace("<!appsList>", appsList);
|
||||||
|
fs.writeFileSync(__dirname + "/../../README.md", finalReadme);
|
||||||
|
};
|
||||||
|
|
||||||
|
const main = async () => {
|
||||||
|
const apps = await getAppsList();
|
||||||
|
const appKeys = Object.keys(apps["apps"]);
|
||||||
|
let appsList = "";
|
||||||
|
|
||||||
|
for (let i = 0; i < appKeys.length; i++) {
|
||||||
|
const appFinal = await appToReadme(apps["apps"][appKeys[i]]);
|
||||||
|
appsList += i == 0 ? appFinal : "\n" + appFinal;
|
||||||
|
}
|
||||||
|
|
||||||
|
writeToReadme(appsList);
|
||||||
|
};
|
||||||
|
|
||||||
|
main();
|
18
README.md
18
README.md
|
@ -1,9 +1,9 @@
|
||||||
# Tipi App Store ⛺️
|
# Tipi App Store ⛺️
|
||||||
|
|
||||||
This is the official repository for the Tipi App Store. It contains all the apps that are available for download on [Tipi](https://github.com/meienberger/runtipi).
|
This is the official repository for the Tipi App Store. It contains all the apps that are available for download on [Tipi](https://github.com/runtipi/runtipi).
|
||||||
|
|
||||||
## Apps available
|
## Apps available
|
||||||
|
|
||||||
- [2FAuth](https://github.com/Bubka/2FAuth) - Manage your Two-Factor Authentication codes.
|
- [2FAuth](https://github.com/Bubka/2FAuth) - Manage your Two-Factor Authentication codes.
|
||||||
- [Activepieces](https://github.com/activepieces/activepieces) - True zapier alternative.
|
- [Activepieces](https://github.com/activepieces/activepieces) - True zapier alternative.
|
||||||
- [Actual Budget](https://github.com/actualbudget/actual-server) - Local-first OpenSource Budget tool
|
- [Actual Budget](https://github.com/actualbudget/actual-server) - Local-first OpenSource Budget tool
|
||||||
|
@ -103,7 +103,6 @@ This is the official repository for the Tipi App Store. It contains all the apps
|
||||||
- [Mastodon](https://github.com/mastodon/mastodon) - Your self-hosted, globally interconnected microblogging community
|
- [Mastodon](https://github.com/mastodon/mastodon) - Your self-hosted, globally interconnected microblogging community
|
||||||
- [Conduit](https://gitlab.com/famedly/conduit) - Conduit is a simple, fast and reliable chat server written in Rust
|
- [Conduit](https://gitlab.com/famedly/conduit) - Conduit is a simple, fast and reliable chat server written in Rust
|
||||||
- [Mealie](https://github.com/hay-kot/mealie) - Mealie is a self-hosted recipe manager and meal planner.
|
- [Mealie](https://github.com/hay-kot/mealie) - Mealie is a self-hosted recipe manager and meal planner.
|
||||||
- [Mealie v0.5.6](https://github.com/hay-kot/mealie) - Mealie is a self-hosted recipe manager and meal planner.
|
|
||||||
- [Memos](https://github.com/usememos/memos) - Memo hub for knowledge management and collaboration.
|
- [Memos](https://github.com/usememos/memos) - Memo hub for knowledge management and collaboration.
|
||||||
- [MeTube](https://github.com/alexta69/metube) - youtube-dl web UI
|
- [MeTube](https://github.com/alexta69/metube) - youtube-dl web UI
|
||||||
- [Mind](https://github.com/Casvt/MIND) - A simple self hosted reminder platform that uses push to send notifications to your device.
|
- [Mind](https://github.com/Casvt/MIND) - A simple self hosted reminder platform that uses push to send notifications to your device.
|
||||||
|
@ -183,7 +182,6 @@ This is the official repository for the Tipi App Store. It contains all the apps
|
||||||
- [Tandoor](https://github.com/TandoorRecipes/recipes) - Recipe collection manager.
|
- [Tandoor](https://github.com/TandoorRecipes/recipes) - Recipe collection manager.
|
||||||
- [Tasks.md](https://github.com/BaldissaraMatheus/Tasks.md) - A self-hosted, file based task management board.
|
- [Tasks.md](https://github.com/BaldissaraMatheus/Tasks.md) - A self-hosted, file based task management board.
|
||||||
- [Tautulli](https://github.com/Tautulli/Tautulli) - Monitoring and tracking tool for Plex Media Server.
|
- [Tautulli](https://github.com/Tautulli/Tautulli) - Monitoring and tracking tool for Plex Media Server.
|
||||||
- [teddit](https://codeberg.org/teddit/teddit) - Alternative Reddit front-end focused on privacy https://teddit.net
|
|
||||||
- [Tooljet](https://github.com/ToolJet/ToolJet) - Alternative to retool to construct CRM dashboard
|
- [Tooljet](https://github.com/ToolJet/ToolJet) - Alternative to retool to construct CRM dashboard
|
||||||
- [Traefik Certs Dumper](https://github.com/kereis/traefik-certs-dumper) - Dumps Let's Encrypt certificates of a specified domain which Traefik stores in acme.json.
|
- [Traefik Certs Dumper](https://github.com/kereis/traefik-certs-dumper) - Dumps Let's Encrypt certificates of a specified domain which Traefik stores in acme.json.
|
||||||
- [Transmission (VPN)](https://github.com/haugene/docker-transmission-openvpn) - BitTorrent client with VPN support.
|
- [Transmission (VPN)](https://github.com/haugene/docker-transmission-openvpn) - BitTorrent client with VPN support.
|
||||||
|
@ -206,11 +204,11 @@ This is the official repository for the Tipi App Store. It contains all the apps
|
||||||
- [Your Spotify](https://github.com/Yooooomi/your_spotify) - Self hosted Spotify tracking dashboard.
|
- [Your Spotify](https://github.com/Yooooomi/your_spotify) - Self hosted Spotify tracking dashboard.
|
||||||
- [ZeroTier](https://github.com/zerotier/ZeroTierOne) - Easy to use zero configuration VPN.
|
- [ZeroTier](https://github.com/zerotier/ZeroTierOne) - Easy to use zero configuration VPN.
|
||||||
- [Zipline](https://github.com/diced/zipline) - A ShareX/file upload server that is easy to use, packed with features, and with an easy setup!
|
- [Zipline](https://github.com/diced/zipline) - A ShareX/file upload server that is easy to use, packed with features, and with an easy setup!
|
||||||
|
|
||||||
## How to sumbit an app
|
## How to sumbit an app
|
||||||
|
|
||||||
If you want to see new apps on Tipi you can either:
|
If you want to see new apps on Tipi you can either:
|
||||||
|
|
||||||
- [Open an issue](https://github.com/meienberger/runtipi-appstore/issues) on this repository and members of the community will add it
|
- [Create a discussion](https://github.com/runtipi/runtipi-appstore/discussions) on this repository and members of the community will add it
|
||||||
- [Join the Discord](https://discord.gg/Bu9qEPnHsc) members of the community will add it.
|
- [Join the Discord](https://discord.gg/Bu9qEPnHsc) members of the community will add it.
|
||||||
- Fork this repo and create the necessary files for a Tipi app. Follow this [guide](<[https://github.com/meienberger/runtipi/wiki/Adding-your-own-app](https://www.runtipi.io/docs/contributing/adding-a-new-app)>)
|
- Fork this repo and create the necessary files for a Tipi app. Follow this [guide](https://www.runtipi.io/docs/contributing/adding-a-new-app)`
|
||||||
|
|
|
@ -1,81 +0,0 @@
|
||||||
import fs from "fs";
|
|
||||||
|
|
||||||
type App = {
|
|
||||||
name: string;
|
|
||||||
description: string;
|
|
||||||
link: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
const getAppsList = async () => {
|
|
||||||
const apps: Record<string, App> = {};
|
|
||||||
// fetch apps from app store repo
|
|
||||||
const res = await fetch(
|
|
||||||
"https://api.github.com/repos/runtipi/runtipi-appstore/contents/apps"
|
|
||||||
);
|
|
||||||
|
|
||||||
const data = await res.json();
|
|
||||||
const appNames = data.map((app) => app.name);
|
|
||||||
|
|
||||||
for (const app of appNames) {
|
|
||||||
const config = await fetch(
|
|
||||||
`https://raw.githubusercontent.com/runtipi/runtipi-appstore/master/apps/${app}/config.json`
|
|
||||||
);
|
|
||||||
const appConfig = await config.text();
|
|
||||||
try {
|
|
||||||
const appConfigJson = JSON.parse(appConfig);
|
|
||||||
|
|
||||||
apps[app] = {
|
|
||||||
name: appConfigJson.name,
|
|
||||||
description: appConfigJson.short_desc,
|
|
||||||
link: appConfigJson.source,
|
|
||||||
};
|
|
||||||
} catch (e) {
|
|
||||||
console.error(`Error parsing config for ${app}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return { apps };
|
|
||||||
};
|
|
||||||
|
|
||||||
const appToReadme = async (app) => {
|
|
||||||
return `- [${app.name}](${app.link}) - ${app.description}`;
|
|
||||||
};
|
|
||||||
|
|
||||||
const writeToReadme = async (appsList) => {
|
|
||||||
let finalReadme = `# Tipi App Store ⛺️
|
|
||||||
|
|
||||||
This is the official repository for the Tipi App Store. It contains all the apps that are available for download on [Tipi](https://github.com/meienberger/runtipi).
|
|
||||||
|
|
||||||
## Apps available
|
|
||||||
|
|
||||||
${appsList}
|
|
||||||
|
|
||||||
## How to sumbit an app
|
|
||||||
|
|
||||||
If you want to see new apps on Tipi you can either:
|
|
||||||
|
|
||||||
- [Open an issue](https://github.com/meienberger/runtipi-appstore/issues) on this repository and members of the community will add it
|
|
||||||
- [Join the Discord](https://discord.gg/Bu9qEPnHsc) members of the community will add it.
|
|
||||||
- Fork this repo and create the necessary files for a Tipi app. Follow this [guide](<[https://github.com/meienberger/runtipi/wiki/Adding-your-own-app](https://www.runtipi.io/docs/contributing/adding-a-new-app)>)`;
|
|
||||||
|
|
||||||
await fs.writeFileSync("README.md", finalReadme);
|
|
||||||
};
|
|
||||||
|
|
||||||
const main = async () => {
|
|
||||||
const apps = await getAppsList();
|
|
||||||
const appKeys = Object.keys(apps["apps"]);
|
|
||||||
let appsList: string = "";
|
|
||||||
|
|
||||||
for (let i = 0; i < appKeys.length; i++) {
|
|
||||||
const appFinal = await appToReadme(apps["apps"][appKeys[i]]);
|
|
||||||
if (i == 0) {
|
|
||||||
appsList = appsList + appFinal;
|
|
||||||
} else {
|
|
||||||
appsList = appsList + "\n" + appFinal;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
await writeToReadme(appsList);
|
|
||||||
};
|
|
||||||
|
|
||||||
main();
|
|
15
templates/README.md
Normal file
15
templates/README.md
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# Tipi App Store ⛺️
|
||||||
|
|
||||||
|
This is the official repository for the Tipi App Store. It contains all the apps that are available for download on [Tipi](https://github.com/runtipi/runtipi).
|
||||||
|
|
||||||
|
## Apps available
|
||||||
|
|
||||||
|
<!appsList>
|
||||||
|
|
||||||
|
## How to sumbit an app
|
||||||
|
|
||||||
|
If you want to see new apps on Tipi you can either:
|
||||||
|
|
||||||
|
- [Create a discussion](https://github.com/runtipi/runtipi-appstore/discussions) on this repository and members of the community will add it
|
||||||
|
- [Join the Discord](https://discord.gg/Bu9qEPnHsc) members of the community will add it.
|
||||||
|
- Fork this repo and create the necessary files for a Tipi app. Follow this [guide](https://www.runtipi.io/docs/contributing/adding-a-new-app)`
|
Loading…
Reference in New Issue
Block a user