diff --git a/.dockerignore b/.dockerignore index 1c1d149..ca42186 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 diff --git a/.gitignore b/.gitignore index b0cdb03..446a169 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 diff --git a/README.md b/README.md index 273f0e3..2836fb8 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 diff --git a/config.json b/config.json index 8cfc3ff..f9fee91 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 diff --git a/docker-compose.yml b/docker-compose.yml index acf9a6d..88369b3 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 diff --git a/src/libpoketube/libpoketube-initsys.js b/src/libpoketube/libpoketube-initsys.js index a255796..2bf2d3e 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);