Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - josephchuks

Pages: [1]
1
Updates / Permission issue after cwppro update
« on: December 20, 2024, 01:59:44 PM »
I use cwppro with a custom codeEditor.php I created:
Code: [Select]
https://github.com/JosephChuks/cwp-codeEditor as I find the default codeEditor not up to what I want.

I changed it for admin and user respectively:
Code: [Select]
/usr/local/cwpsrv/htdocs/admin/admin/codeEditor.php and
Code: [Select]
/usr/local/cwpsrv/var/services/users/codeEditor.php and it has been working fine until the recent cwppro update. Although I created a script to overwrite the default cwppro codeEditor.php any time there's an update:

Code: [Select]
#!/bin/bash

# Paths
ORIGINAL_FILES_ADMIN="/usr/local/cwpsrv/htdocs/admin/admin/codeEditor.php"
ORIGINAL_FILES_USER="/usr/local/cwpsrv/var/services/users/codeEditor.php"
CUSTOM_FILE="/root/codeEditor.php"

# Log file
LOG_FILE="/var/log/code_editor_restore.log"

# Function to restore admin file
restore_admin_file() {
    local original_file="$1"
    if [ ! -f "$original_file" ] || [ "$(stat -c%s "$original_file")" -ne "$(stat -c%s "$CUSTOM_FILE")" ]; then
        echo "$(date) - $original_file was overwritten. Restoring custom version." >> "$LOG_FILE"
        cp "$CUSTOM_FILE" "$original_file"
        chown root:root "$original_file"
        chmod 644 "$original_file"
    fi
}

# Function to restore user file
restore_user_file() {
    local original_file="$1"
    if [ ! -f "$original_file" ] || [ "$(stat -c%s "$original_file")" -ne "$(stat -c%s "$CUSTOM_FILE")" ]; then
        echo "$(date) - $original_file was overwritten. Restoring custom version." >> "$LOG_FILE"
        cp "$CUSTOM_FILE" "$original_file"
        chown cwpsvc:cwpsvc "$original_file"
        chmod 644 "$original_file"
    fi
}

# Restore files
restore_admin_file "$ORIGINAL_FILES_ADMIN"
restore_user_file "$ORIGINAL_FILES_USER"

The script works fine as it did the job of overwriting the default codeEditor after the update for user:
Code: [Select]
/usr/local/cwpsrv/var/services/users/codeEditor.php  but throws a permission error for the admin:

Code: [Select]
cp: cannot create regular file '/usr/local/cwpsrv/htdocs/admin/admin/codeEditor.php': Operation not permitted
chown: changing ownership of '/usr/local/cwpsrv/htdocs/admin/admin/codeEditor.php': Operation not permitted
chmod: changing permissions of '/usr/local/cwpsrv/htdocs/admin/admin/codeEditor.php': Operation not permitted

2
I can build it / CWP Custom CodeEditor (Based on Ace Editor)
« on: September 18, 2024, 03:55:13 PM »
Enhance your CWPPro experience with a customized CodeEditor built using the powerful Ace Editor! This improved code editor offers multiple themes (dark and light), built-in code formatting, search and replace functionality, and much more.

Github Repo: https://github.com/JosephChuks/cwp-codeEditor



3
Other / MongoDB Manager not working if authentication is turned on
« on: September 07, 2024, 05:56:39 PM »
I just started using cwp and I'm using the pro version. I am coming from HestiaCP and was drawn to cwp due to it's NodeJS and MongoDB managers.

I installed a nodejs app and mongodb database and it's working fine but I have a security concern which I've tried to fix but can't.

My VPS is running Almalinux 8 and I could only get Mongodb version 4 to install via the admin panel. I found out that the mongodb is publicy accessible via mongodb://server_ip:monogdb_port without authentication, So the problem here now is when I enable the security authentication, the mongodb manager stops working on the admin panel and also the user panel but will work via command line and also will require authentication via compass.

I use my VPS for business and would like my clients to be able to create dbs from the user panel easily as this is my major reason for switching to cwp.

Is there anyone with same problem or steps on how to fix this?

PS: I have tried so many solutions without success. :-[

Pages: [1]