From e4d9cd49e2a240e3eef38a0ef32ffabdaa8061ce Mon Sep 17 00:00:00 2001 From: Korbs Date: Wed, 22 Nov 2023 22:45:49 -0500 Subject: [PATCH 1/6] Add the database file to gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b0cdb032..446a169f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules/ yarn.lock package-lock.json -.env \ No newline at end of file +.env +json.sqlite From 17bb4d04d467cf5fc80bb3bd48c2053738daaeef Mon Sep 17 00:00:00 2001 From: Korbs Date: Wed, 22 Nov 2023 22:46:03 -0500 Subject: [PATCH 2/6] Add the server port as a configuration option --- config.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config.json b/config.json index 8cfc3ffa..f9fee911 100644 --- a/config.json +++ b/config.json @@ -5,5 +5,6 @@ "invchannel": "https://invid-api.poketube.fun/api/v1", "cacher_max_age": "1800", "enablealwayshttps": false, - "t_url": "https://t.poketube.fun/" + "t_url": "https://t.poketube.fun/", + "server_port": "6003" } \ No newline at end of file From cfd6e8d9f91b97a20b181fa2a0a9ed10901ed8f4 Mon Sep 17 00:00:00 2001 From: Korbs Date: Wed, 22 Nov 2023 22:46:19 -0500 Subject: [PATCH 3/6] Use port number from config.json file --- src/libpoketube/libpoketube-initsys.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libpoketube/libpoketube-initsys.js b/src/libpoketube/libpoketube-initsys.js index a2557964..2bf2d3e4 100644 --- a/src/libpoketube/libpoketube-initsys.js +++ b/src/libpoketube/libpoketube-initsys.js @@ -16,6 +16,7 @@ const fetcher = require("../libpoketube/libpoketube-dislikes.js"); const core = require("../libpoketube/libpoketube-core.js"); const musicInfo = require("music-info"); const wiki = require("wikipedia"); +const config = require("../../config.json") const fetch = require("node-fetch"); const toJson = require("xml2json").toJson; @@ -40,10 +41,10 @@ function initlog(args) { * Initializes the application and starts listening on the specified port or something idk aaaaa help me * * @param {object} app - The express application - * @param {string} [port="3000"] - The port to listen on + * @param {string} [port=config.server_port] - The port to listen on */ function init(app, port) { - if (!port) port = "6003"; + if (!port) port = config.server_port; try { app.listen(port, () => { initlog("Loading Poketube: success!" + " on port " + port); From 0488ef7d874bf8b9ead4681f020f491c529b1133 Mon Sep 17 00:00:00 2001 From: Korbs Date: Wed, 22 Nov 2023 22:48:04 -0500 Subject: [PATCH 4/6] Add docker files to .dockerignore --- .dockerignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index 1c1d1499..ca42186d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,4 +5,6 @@ node_modules invidious-source json.sqlite -*.md \ No newline at end of file +*.md +docker-compose.yml +Dockerfile \ No newline at end of file From 0fff4ae62cc9722880e51639d87e4c8c6d2cebe4 Mon Sep 17 00:00:00 2001 From: Korbs Date: Wed, 22 Nov 2023 22:48:14 -0500 Subject: [PATCH 5/6] Create docker compose file for PokeTube --- docker-compose.yml | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index acf9a6d7..88369b33 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,17 +1,9 @@ +version: "3" services: - proxy: - build: - context: . - dockerfile: p/Dockerfile - target: release-aio - # cache_to: - # cache_from: + poketube: + image: quay.io/sudovanilla/poketube restart: unless-stopped + volumes: + - ./config.json:/poketube/config.json ports: - - 80:80 - - 443:443 - # - 3000:3000 - environment: - - HOSTNAME=example.com - - EMAIL=user@email.com # required for https - - STAGING=true # Set to "true" to use staging + - "6003:6003" \ No newline at end of file From 89071a3d5db4eae509dfc2215901e45303b70490 Mon Sep 17 00:00:00 2001 From: Korbs Date: Wed, 22 Nov 2023 22:48:26 -0500 Subject: [PATCH 6/6] Add instructions on running PokeTube in Docker --- README.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 273f0e3e..2836fb8b 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ you can view the source code of the openh264 codec in this repo :3 --> https://g PLEASE NOTE THAT THIS SOFTWARE MAY INCULUDE CODECS THAT IN CERTAIN COUNTRIES MAY BE COVERED BY PATENTS OR HAVE LEGAL ISSUES. PATENT AND COPYRIGHT LAWS OPERATE DIFFERENTLY DEPENDING ON WHICH COUNTRY YOU ARE IN. PLEASE OBTAIN LEGAL ADVICE IF YOU ARE UNSURE WHETHER A PARTICULAR PATENT OR RESTRICTION APPLIES TO A CODEC YOU WISH TO USE IN YOUR COUNTRY. ## Hosting Poketube~ - +### With NodeJS - To self host your own Poketube instance, you'll need the following: - [Node.js](https://nodejs.org/en/download/) @@ -98,6 +98,26 @@ node server.js Congrats, Poketube should now be running on `localhost:6003`! +### With Docker +Create a new directory for PokeTube: +``` +mkdir poketube && cd poketube +``` + +Download the docker compose and config file: +``` +curl -O https://codeberg.org/Ashley/poketube/raw/branch/main/docker-compose.yml +``` + +Run PokeTube: +``` +docker compose up -d +``` + +PokeTube should be running on `http://localhost:6003`. + +The port can be changed with the config file you downloaded, just change the `server_port` option. + ## PokeTube community! Join the community on [revolt](https://rvlt.gg/poketube) :3