diff --git a/Dockerfile b/Dockerfile index 5ea2247..2c218fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,8 @@ ARG RANETO_RELEASE LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="thelamer" +ENV PORT=3000 + RUN \ echo "**** install build packages ****" && \ apk add --no-cache --virtual=build-dependencies \ @@ -33,7 +35,12 @@ RUN \ /app/raneto --strip-components=1 && \ echo "**** install raneto node dev modules and build ****" && \ cd /app/raneto && \ + sed -i \ + 's/upgradeInsecureRequests: \[\]/upgradeInsecureRequests: null/g' \ + app/index.js && \ npm install --omit=dev && \ + mkdir sessions && \ + rm -f config/config.js && \ printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \ echo "**** cleanup ****" && \ apk del --purge \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index b126cd9..45d7aaf 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -9,6 +9,8 @@ ARG RANETO_RELEASE LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="thelamer" +ENV PORT=3000 + RUN \ echo "**** install build packages ****" && \ apk add --no-cache --virtual=build-dependencies \ @@ -33,7 +35,12 @@ RUN \ /app/raneto --strip-components=1 && \ echo "**** install raneto node dev modules and build ****" && \ cd /app/raneto && \ + sed -i \ + 's/upgradeInsecureRequests: \[\]/upgradeInsecureRequests: null/g' \ + app/index.js && \ npm install --omit=dev && \ + mkdir sessions && \ + rm -f config/config.js && \ printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \ echo "**** cleanup ****" && \ apk del --purge \ diff --git a/README.md b/README.md index c368186..7ce6083 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ The default username and password is *admin/password* This application can only be configured through file storage the web interface is only for editing Markdown files. You need to understand the following paths and the role they play for the application: -* /config/config.default.js - Main configuration file to setup your user, site name, etc. +* /config/config/config.js - Main configuration file to setup your user, site name, etc. * /config/content - All of your Markdown files go here [more info](http://docs.raneto.com/usage/creating-pages). * /config/images - This folder will serve content on http://:3000/images/.png you can put anything in here but it is specifically for image files so you can embed them in your Markdown files without using external hosting. @@ -281,6 +281,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **16.09.25:** - Many changes for upstream release, if upgrading a new configuration file might be needed. * **27.07.25:** - Rebase to Alpine 3.22. * **01.02.25:** - Rebase to Alpine 3.21. * **06.06.24:** - Rebase to Alpine 3.20. diff --git a/readme-vars.yml b/readme-vars.yml index 15dd4b8..8525eb6 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -31,7 +31,7 @@ app_setup_block: | This application can only be configured through file storage the web interface is only for editing Markdown files. You need to understand the following paths and the role they play for the application: - * /config/config.default.js - Main configuration file to setup your user, site name, etc. + * /config/config/config.js - Main configuration file to setup your user, site name, etc. * /config/content - All of your Markdown files go here [more info](http://docs.raneto.com/usage/creating-pages). * /config/images - This folder will serve content on http://:3000/images/.png you can put anything in here but it is specifically for image files so you can embed them in your Markdown files without using external hosting. # init diagram @@ -77,6 +77,7 @@ init_diagram: | "raneto:latest" <- Base Images # changelog changelogs: + - {date: "16.09.25:", desc: "Many changes for upstream release, if upgrading a new configuration file might be needed."} - {date: "27.07.25:", desc: "Rebase to Alpine 3.22."} - {date: "01.02.25:", desc: "Rebase to Alpine 3.21."} - {date: "06.06.24:", desc: "Rebase to Alpine 3.20."} diff --git a/root/defaults/config.default.js b/root/defaults/config.js similarity index 85% rename from root/defaults/config.default.js rename to root/defaults/config.js index 9a7d22b..307dc1f 100644 --- a/root/defaults/config.default.js +++ b/root/defaults/config.js @@ -1,22 +1,24 @@ // Modules -var path = require('path'); +import path from 'node:path'; // Which Theme to Use? // // Local Directory Example (for development or custom themes) -// var theme_dir = path.join(__dirname, 'themes'); -// var theme_name = 'my-theme-directory'; +// const theme_dir = path.join(__dirname, 'themes'); +// const theme_name = 'my-theme-directory'; // // Themes from NPM // use "dist" as the theme name for modules (for now) -var theme_dir = path.join( - '/app/raneto', +const __dirname = import.meta.dirname; +const app_root = process.cwd(); // This will be '/app/raneto' or similar +const theme_dir = path.join( + app_root, 'node_modules', - '@raneto/theme-default' + '@raneto/theme-default', ); -var theme_name = 'dist'; +const theme_name = 'dist'; -var config = { +const config = { // Your site title (format: page_title - site_title) site_title: 'Raneto Docs', @@ -41,7 +43,7 @@ var config = { support_email: '', // Footer Text / Copyright - copyright: `Copyright © ${new Date().getFullYear()} - Powered by Raneto`, + copyright: `Copyright © ${new Date().getFullYear()} Raneto Team`, // Excerpt length (used in search) excerpt_length: 400, @@ -58,13 +60,17 @@ var config = { // all categories or files that do not specify ShowOnHome meta property will be shown show_on_home_default: true, + // Controls behavior of the menu if meta ShowOnMenu is not present. If set to true + // all categories or files that do not specify ShowOnMenu meta property will be shown + show_on_menu_default: true, + // Theme (see top of file) theme_dir, theme_name, // Specify the path of your content folder where all your '.md' files are located // Fix: Cannot be an absolute path - content_dir : '/config/content/', + content_dir: path.join(__dirname, '..', 'content', 'pages'), // Where is the public directory or document root? public_dir: path.join(theme_dir, theme_name, 'public'), @@ -99,7 +105,7 @@ var config = { oauth2: { client_id: 'GOOGLE_CLIENT_ID', client_secret: 'GOOGLE_CLIENT_SECRET', - callback: 'http://localhost:3000/auth/google/callback', + callback: 'http://localhost:8080/auth/google/callback', hostedDomain: 'google.com', }, secret: 'someCoolSecretRightHere', @@ -166,4 +172,4 @@ var config = { }; // Exports -module.exports = config; +export default config; diff --git a/root/defaults/server.js b/root/defaults/server.js deleted file mode 100644 index 6695dfd..0000000 --- a/root/defaults/server.js +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env node - -// Modules -var debug = require('debug')('raneto'); - -// Here is where we load Raneto. -// When you are in your own project repository, -// Raneto should be installed via NPM and loaded as: -var raneto = require('./app/index.js'); - -// Then, we load our configuration file -// This can be done inline, with a JSON file, -// or with a Node.js module as we do below. -var config = require('/config/config.default.js'); - -// Finally, we initialize Raneto -// with our configuration object -var app = raneto(config); - -// Load the HTTP Server -var server = app.listen(app.get('port'), app.get('host'), () => { - debug(`Express HTTP server listening on port ${server.address().port}`); -}); diff --git a/root/etc/s6-overlay/s6-rc.d/init-raneto-config/run b/root/etc/s6-overlay/s6-rc.d/init-raneto-config/run index 40ca000..11c6b3e 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-raneto-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-raneto-config/run @@ -4,6 +4,8 @@ folders=( /app/raneto/node_modules/@raneto/theme-default/dist/public/images /app/raneto/content + /app/raneto/config + /app/raneto/sessions ) for i in "${folders[@]}"; do @@ -18,14 +20,14 @@ for i in "${folders[@]}"; do fi done -# create local user server files -if [[ ! -f /config/config.default.js ]]; then - cp /defaults/config.default.js /config/config.default.js +# upgrade support +if [[ -f /config/config.default.js ]]; then + mv /config/config.default.js /config/config/config.js fi -if [[ -f "/defaults/server.js" ]]; then - rm -rf "/app/raneto/server.js" - mv "/defaults/server.js" "/app/raneto/server.js" +# copy default config +if [[ ! -f /config/config/config.js ]]; then + cp /defaults/config.js /config/config/config.js fi # permissions