habitica is not even working #578

Closed
opened 2026-02-04 20:05:02 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @papadopouloskyriakos on GitHub (Mar 3, 2025).

Have you read and understood the above guidelines?

yes

📜 What is the name of the script you are using?

habitica

📂 What was the exact command used to execute the script?

bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/habitica.sh)"

📝 Provide a clear and concise description of the issue.

it is a dev version that not working behind a proxy and it is not even stable or tested... why bothering putting it up to the main scripts if this is broken?

⚙️ What settings are you using?

  • Default Settings
  • Advanced Settings

🖥️ Which Linux distribution are you using?

No response

🔄 Steps to reproduce the issue.

just install it and try adding it behind a proxy

Paste the full error output (if available).

n/a

🖼️ Additional context (optional).

No response

Originally created by @papadopouloskyriakos on GitHub (Mar 3, 2025). ### ✅ Have you read and understood the above guidelines? yes ### 📜 What is the name of the script you are using? habitica ### 📂 What was the exact command used to execute the script? bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/habitica.sh)" ### 📝 Provide a clear and concise description of the issue. it is a dev version that not working behind a proxy and it is not even stable or tested... why bothering putting it up to the main scripts if this is broken? ### ⚙️ What settings are you using? - [ ] Default Settings - [ ] Advanced Settings ### 🖥️ Which Linux distribution are you using? _No response_ ### 🔄 Steps to reproduce the issue. just install it and try adding it behind a proxy ### ❌ Paste the full error output (if available). n/a ### 🖼️ Additional context (optional). _No response_
OVERLORD added the bug label 2026-02-04 20:05:02 +03:00
Author
Owner

@MickLesk commented on GitHub (Mar 3, 2025):

@tremor021

@MickLesk commented on GitHub (Mar 3, 2025): @tremor021
Author
Owner

@MickLesk commented on GitHub (Mar 3, 2025):

1st)
Use the current Release, Not Dev, IT crawles the latest stable Release
RELEASE=$(curl -s https://api.github.com/repos/HabitRPG/habitica/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')

2nd)
You can expect a little gratitude, right? What's this stupid comment about being under-tested? We test the scripts as much as we can.

3th)
If you want to do it behind a proxy, that is not part of the script and your topic. We can support, but that is not part of the script.

Next time be more friendly, otherwise we will think 10 times about what we include in such scripts.

@MickLesk commented on GitHub (Mar 3, 2025): 1st) Use the current Release, Not Dev, IT crawles the latest stable Release RELEASE=$(curl -s https://api.github.com/repos/HabitRPG/habitica/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') 2nd) You can expect a little gratitude, right? What's this stupid comment about being under-tested? We test the scripts as much as we can. 3th) If you want to do it behind a proxy, that is not part of the script and your topic. We can support, but that is not part of the script. Next time be more friendly, otherwise we will think 10 times about what we include in such scripts.
Author
Owner

@papadopouloskyriakos commented on GitHub (Mar 3, 2025):

1st) Use the current Release, Not Dev, IT crawles the latest stable Release RELEASE=$(curl -s https://api.github.com/repos/HabitRPG/habitica/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')

2nd) You can expect a little gratitude, right? What's this stupid comment about being under-tested? We test the scripts as much as we can.

3th) If you want to do it behind a proxy, that is not part of the script and your topic. We can support, but that is not part of the script.

Next time be more friendly, otherwise we will think 10 times about what we include in such scripts.

I apreciate your time and effort to put up to these scripts, I think I got overexited to get this working and by failing to see a stable result I got frustrated after many retries. I could have been more friendly indeed. Apologies and keep on the good work!

@papadopouloskyriakos commented on GitHub (Mar 3, 2025): > 1st) Use the current Release, Not Dev, IT crawles the latest stable Release RELEASE=$(curl -s https://api.github.com/repos/HabitRPG/habitica/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') > > 2nd) You can expect a little gratitude, right? What's this stupid comment about being under-tested? We test the scripts as much as we can. > > 3th) If you want to do it behind a proxy, that is not part of the script and your topic. We can support, but that is not part of the script. > > Next time be more friendly, otherwise we will think 10 times about what we include in such scripts. I apreciate your time and effort to put up to these scripts, I think I got overexited to get this working and by failing to see a stable result I got frustrated after many retries. I could have been more friendly indeed. Apologies and keep on the good work!
Author
Owner

@tremor021 commented on GitHub (Mar 3, 2025):

@llzzrrdd I'm the author of the script. As you can imagine, we can't really be responsible how people use our scripts, hence why we focus only on installing the app and making it run. All additional configuration is really up to user, as we can't know how users are gonna use it, this includes various proxies or additional plugins some use.

@MickLesk already told you that we crawl their official github and install the app from their source. They say in their docs that github source should work and behave as their website version, so i can't really tell you or support anything more than that.
If you have troubles setting up proxy to access the web UI, you should seek help from devs, at their github.

@tremor021 commented on GitHub (Mar 3, 2025): @llzzrrdd I'm the author of the script. As you can imagine, we can't really be responsible how people use our scripts, hence why we focus only on installing the app and making it run. All additional configuration is really up to user, as we can't know how users are gonna use it, this includes various proxies or additional plugins some use. @MickLesk already told you that we crawl their official github and install the app from their source. They say in their docs that github source should work and behave as their website version, so i can't really tell you or support anything more than that. If you have troubles setting up proxy to access the web UI, you should seek help from devs, at their github.
Author
Owner

@papadopouloskyriakos commented on GitHub (Mar 4, 2025):

@MickLesk @tremor021 In case it helps somebody else, by making some changes at the following /opt/habitica/website/client/vue.config.js I was able to make a proxy host at "Nginx Proxy Manager" pointing at the LXC's IP address / Scheme: https / Forward Port: 8080 / Websockets: Enabled / Advanced: proxy_set_header Host $host;

(BACKUP FIRST) cp /opt/habitica/website/client/vue.config.js /opt/habitica/website/client/vue.config.js.orig
echo "" > /opt/habitica/website/client/vue.config.js
paste the following at /opt/habitica/website/client/vue.config.js
restart services or reboot LXC

`

/* eslint-disable import/no-commonjs */
const path = require('path');
const fs = require('fs');
const webpack = require('webpack');
const nconf = require('nconf');
const vueTemplateCompiler = require('vue-template-babel-compiler');
const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
const setupNconf = require('../server/libs/setupNconf');
const pkg = require('./package.json');

const configFile = path.join(path.resolve(__dirname, '../../config.json'));

// Initialize configuration
setupNconf(configFile, nconf);

// Retrieve backend server URL for API proxying (Habitica Server runs on 3000)
const DEV_BASE_URL = nconf.get('BASE_URL'); // Expected to be "http://localhost:3000"

// List environment variables to inject (removed "BASE_URL" to avoid conflict)
const envVars = [
'AMAZON_PAYMENTS_SELLER_ID',
'AMAZON_PAYMENTS_CLIENT_ID',
'AMAZON_PAYMENTS_MODE',
'EMAILS_COMMUNITY_MANAGER_EMAIL',
'EMAILS_TECH_ASSISTANCE_EMAIL',
'EMAILS_PRESS_ENQUIRY_EMAIL',
// 'BASE_URL', <-- removed to prevent conflicting definitions
'GA_ID',
'STRIPE_PUB_KEY',
'GOOGLE_CLIENT_ID',
'APPLE_AUTH_CLIENT_ID',
'AMPLITUDE_KEY',
'LOGGLY_CLIENT_TOKEN',
'TRUSTED_DOMAINS',
'TIME_TRAVEL_ENABLED',
'DEBUG_ENABLED',
'CONTENT_SWITCHOVER_TIME_OFFSET',
];

const envObject = {};
envVars.forEach(key => {
envObject[process.env.${key}] = '${nconf.get(key)}';
});

const webpackPlugins = [
new webpack.ProvidePlugin({ 'window.jQuery': 'jquery' }),
new webpack.DefinePlugin(envObject),
new MomentLocalesPlugin({
localesToKeep: [
'bg', 'cs', 'da', 'de', 'en', 'es', 'fr', 'he', 'hu', 'id',
'it', 'ja', 'nl', 'pl', 'pt', 'pt-br', 'ro', 'ru', 'sk', 'sv',
'tr', 'uk', 'zh-cn', 'zh-tw',
],
}),
new webpack.IgnorePlugin({
checkResource(resource, context) {
if ((context.includes('sinon') || resource.includes('sinon') || context.includes('nise')) && nconf.get('TIME_TRAVEL_ENABLED') !== 'true') {
return true;
}
if (context.includes('yargs')) {
return true;
}
return false;
},
}),
];

module.exports = {
assetsDir: 'static',
// Use the default publicPath ("/") or adjust if needed
publicPath: '/',
configureWebpack: {
module: {
rules: [
{
test: /.svg/,
dependency: { not: ['url'] },
type: 'asset/source',
},
{
test: /.js$/,
// Exclude transpiling node_modules except for bootstrap-vue/src
exclude: /node_modules/(?!bootstrap-vue/src/)/,
use: {
loader: 'babel-loader',
options: { presets: ['@babel/preset-env'] },
},
},
{
test: /.js$/,
// Exclude transpiling node_modules except for validator
exclude: /node_modules/(?!validator)/,
use: {
loader: 'babel-loader',
options: { presets: ['@babel/preset-env'] },
},
},
],
},
resolve: {
fallback: {
crypto: false,
fs: false,
os: false,
path: false,
stream: false,
timers: require.resolve('timers-browserify'),
},
alias: {
'bootstrap-vue$': 'bootstrap-vue/src/index.js',
},
},
plugins: webpackPlugins,
},
chainWebpack: config => {
// Manually resolve dependencies to avoid duplicates
Object.keys(pkg.dependencies).forEach(dep => {
config.resolve.alias.set(dep, path.resolve(__dirname, ./node_modules/${dep}));
});
// Remove preload plugin in development to address Safari caching issues
if (process.env.NODE_ENV === 'development') {
config.plugins.delete('preload');
}
// Enable optional chaining in Vue templates
config.module
.rule('vue')
.use('vue-loader')
.tap(options => {
options.compiler = vueTemplateCompiler;
return options;
});
},

devServer: {
host: '0.0.0.0', // Listen on all interfaces
port: 8080, // Dev server port
allowedHosts: 'all', // Relax host header checking
headers: { 'Cache-Control': 'no-store' },
proxy: {
// Forward API requests to the backend server on localhost:3000
'^/api/v3': { target: DEV_BASE_URL, changeOrigin: true, ws: true },
'^/api/v4': { target: DEV_BASE_URL, changeOrigin: true, ws: true },
'^/stripe': { target: DEV_BASE_URL, changeOrigin: true },
'^/amazon': { target: DEV_BASE_URL, changeOrigin: true },
'^/paypal': { target: DEV_BASE_URL, changeOrigin: true },
'^/logout-server': { target: DEV_BASE_URL, changeOrigin: true },
'^/export': { target: DEV_BASE_URL, changeOrigin: true },
'^/analytics': { target: DEV_BASE_URL, changeOrigin: true },
},
client: {
// Configure WebSocket connections to use wss:// when the page is served over HTTPS
webSocketURL: {
protocol: 'wss',
hostname: 'habitica.nuclearlighters.net',
port: 443,
pathname: '/ws',
},
},
// Enable HTTPS on the dev server (using snake-oil certificates; replace with valid ones if available)
https: {
key: fs.readFileSync('/etc/ssl/private/ssl-cert-snakeoil.key'),
cert: fs.readFileSync('/etc/ssl/certs/ssl-cert-snakeoil.pem'),
},
},
};

`

@papadopouloskyriakos commented on GitHub (Mar 4, 2025): @MickLesk @tremor021 In case it helps somebody else, by making some changes at the following /opt/habitica/website/client/vue.config.js I was able to make a proxy host at "Nginx Proxy Manager" pointing at the LXC's IP address / Scheme: https / Forward Port: 8080 / Websockets: Enabled / Advanced: proxy_set_header Host $host; (BACKUP FIRST) cp /opt/habitica/website/client/vue.config.js /opt/habitica/website/client/vue.config.js.orig echo "" > /opt/habitica/website/client/vue.config.js paste the following at /opt/habitica/website/client/vue.config.js restart services or reboot LXC ` /* eslint-disable import/no-commonjs */ const path = require('path'); const fs = require('fs'); const webpack = require('webpack'); const nconf = require('nconf'); const vueTemplateCompiler = require('vue-template-babel-compiler'); const MomentLocalesPlugin = require('moment-locales-webpack-plugin'); const setupNconf = require('../server/libs/setupNconf'); const pkg = require('./package.json'); const configFile = path.join(path.resolve(__dirname, '../../config.json')); // Initialize configuration setupNconf(configFile, nconf); // Retrieve backend server URL for API proxying (Habitica Server runs on 3000) const DEV_BASE_URL = nconf.get('BASE_URL'); // Expected to be "http://localhost:3000" // List environment variables to inject (removed "BASE_URL" to avoid conflict) const envVars = [ 'AMAZON_PAYMENTS_SELLER_ID', 'AMAZON_PAYMENTS_CLIENT_ID', 'AMAZON_PAYMENTS_MODE', 'EMAILS_COMMUNITY_MANAGER_EMAIL', 'EMAILS_TECH_ASSISTANCE_EMAIL', 'EMAILS_PRESS_ENQUIRY_EMAIL', // 'BASE_URL', <-- removed to prevent conflicting definitions 'GA_ID', 'STRIPE_PUB_KEY', 'GOOGLE_CLIENT_ID', 'APPLE_AUTH_CLIENT_ID', 'AMPLITUDE_KEY', 'LOGGLY_CLIENT_TOKEN', 'TRUSTED_DOMAINS', 'TIME_TRAVEL_ENABLED', 'DEBUG_ENABLED', 'CONTENT_SWITCHOVER_TIME_OFFSET', ]; const envObject = {}; envVars.forEach(key => { envObject[`process.env.${key}`] = `'${nconf.get(key)}'`; }); const webpackPlugins = [ new webpack.ProvidePlugin({ 'window.jQuery': 'jquery' }), new webpack.DefinePlugin(envObject), new MomentLocalesPlugin({ localesToKeep: [ 'bg', 'cs', 'da', 'de', 'en', 'es', 'fr', 'he', 'hu', 'id', 'it', 'ja', 'nl', 'pl', 'pt', 'pt-br', 'ro', 'ru', 'sk', 'sv', 'tr', 'uk', 'zh-cn', 'zh-tw', ], }), new webpack.IgnorePlugin({ checkResource(resource, context) { if ((context.includes('sinon') || resource.includes('sinon') || context.includes('nise')) && nconf.get('TIME_TRAVEL_ENABLED') !== 'true') { return true; } if (context.includes('yargs')) { return true; } return false; }, }), ]; module.exports = { assetsDir: 'static', // Use the default publicPath ("/") or adjust if needed publicPath: '/', configureWebpack: { module: { rules: [ { test: /\.svg/, dependency: { not: ['url'] }, type: 'asset/source', }, { test: /\.js$/, // Exclude transpiling node_modules except for bootstrap-vue/src exclude: /node_modules\/(?!bootstrap-vue\/src\/)/, use: { loader: 'babel-loader', options: { presets: ['@babel/preset-env'] }, }, }, { test: /\.js$/, // Exclude transpiling node_modules except for validator exclude: /node_modules\/(?!validator)/, use: { loader: 'babel-loader', options: { presets: ['@babel/preset-env'] }, }, }, ], }, resolve: { fallback: { crypto: false, fs: false, os: false, path: false, stream: false, timers: require.resolve('timers-browserify'), }, alias: { 'bootstrap-vue$': 'bootstrap-vue/src/index.js', }, }, plugins: webpackPlugins, }, chainWebpack: config => { // Manually resolve dependencies to avoid duplicates Object.keys(pkg.dependencies).forEach(dep => { config.resolve.alias.set(dep, path.resolve(__dirname, `./node_modules/${dep}`)); }); // Remove preload plugin in development to address Safari caching issues if (process.env.NODE_ENV === 'development') { config.plugins.delete('preload'); } // Enable optional chaining in Vue templates config.module .rule('vue') .use('vue-loader') .tap(options => { options.compiler = vueTemplateCompiler; return options; }); }, devServer: { host: '0.0.0.0', // Listen on all interfaces port: 8080, // Dev server port allowedHosts: 'all', // Relax host header checking headers: { 'Cache-Control': 'no-store' }, proxy: { // Forward API requests to the backend server on localhost:3000 '^/api/v3': { target: DEV_BASE_URL, changeOrigin: true, ws: true }, '^/api/v4': { target: DEV_BASE_URL, changeOrigin: true, ws: true }, '^/stripe': { target: DEV_BASE_URL, changeOrigin: true }, '^/amazon': { target: DEV_BASE_URL, changeOrigin: true }, '^/paypal': { target: DEV_BASE_URL, changeOrigin: true }, '^/logout-server': { target: DEV_BASE_URL, changeOrigin: true }, '^/export': { target: DEV_BASE_URL, changeOrigin: true }, '^/analytics': { target: DEV_BASE_URL, changeOrigin: true }, }, client: { // Configure WebSocket connections to use wss:// when the page is served over HTTPS webSocketURL: { protocol: 'wss', hostname: 'habitica.nuclearlighters.net', port: 443, pathname: '/ws', }, }, // Enable HTTPS on the dev server (using snake-oil certificates; replace with valid ones if available) https: { key: fs.readFileSync('/etc/ssl/private/ssl-cert-snakeoil.key'), cert: fs.readFileSync('/etc/ssl/certs/ssl-cert-snakeoil.pem'), }, }, }; `
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ProxmoxVE#578