Skip to content

Configure

Having issues with configuration ?

241 Topics 4.3k Posts

Subcategories


  • Looking to revamp your site layout?

    121 Topics
    2k Posts

    @crazycells it is, yes - I think I’ll leave it as there is no specific PWA CSS classes I know of. Well, you could use something like the below, but this means multiple CSS files for different operating systems.

    /** * Determine the mobile operating system. * This function returns one of 'iOS', 'Android', 'Windows Phone', or 'unknown'. * * @returns {String} */ function getMobileOperatingSystem() { var userAgent = navigator.userAgent || navigator.vendor || window.opera; // Windows Phone must come first because its UA also contains "Android" if (/windows phone/i.test(userAgent)) { return "Windows Phone"; } if (/android/i.test(userAgent)) { return "Android"; } if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) { return "iOS"; } return "unknown"; // return “Android” - one should either handle the unknown or fallback to a specific platform, let’s say Android }

    Once you’re in that rabbit hole, it’s impossible to get out of it.

  • Problems with performance ?

    19 Topics
    284 Posts

    Lower grade VPS instances, whilst cheap, do have the inherent issue in the fact that they only have 1Gb of RAM. In most cases, this is enough for relatively small or minor projects, but when you need more RAM that you actually have, you’ll quickly find that instance exhausted, and your applications crashing as a result.

    This is where the swap file comes into play. Adding a swap can significantly improve performance on low budget hosts, but without direct root access, this is not going to be possible. If you own a VPS that has root level access and need to add a swap, follow the below guide.

    First, what exactly is a Swap?

    swap is a section of hard disk space that has been set reserved for the operating system to temporarily store data that it is unable to hold in RAM. This step allows you increase the amount of information that your server can keep in its working memory (but not without with some caveats, which I’ll explain below). The swap space on the hard disk will be used mostly when there is no more sufficient space in RAM to host any in-use application data.

    The information written to disk will be far slower than information kept in RAM (RAM is superior in terms of speed owing to its architecture), but the operating system will prefer to keep running application data in memory and only use the swap for the older data. Essentially, having swap space as a failsafe for when your system’s physical memory is depleted can be a good safety net against crashes on systems with non-SSD storage available.

    Determine the size of the Swap we actually need.

    This process is made so much easier by using the below calculator

    https://pickwicksoft.github.io/swapcalc/

    Admittedly, if you only had 1Gb RAM, the SWAP would be default at 1Gb. You can play with the various configurations here to get the results you need, but be honest - don’t make your system out to be something it isn’t, because otherwise, you’ll create more problems than you set out to resolve.

    Swap space refers to a designated portion of hard drive storage that’s reserved for temporary data storage by the operating system when the RAM can’t accommodate it any longer. This allows for an expansion of the data that your server can hold in its active memory, though with certain conditions. The swap area on the hard drive comes into play primarily when there isn’t enough room left in the RAM to hold active application data.

    The data that gets written to the disk is notably slower than the data stored in RAM. Nevertheless, the operating system prioritizes keeping currently used application data in memory and employs swap for older data. Having swap space as a fallback when your system’s RAM is exhausted can serve as a valuable safeguard against out-of-memory errors, especially on systems with traditional non-SSD storage.

    Verifying the System for Swap Information

    Before proceeding, it’s advisable to confirm whether your system already has existing swap space. While it’s possible to have multiple swap files or swap partitions, typically one should suffice.

    You can check if your system has any configured swap by executing:

    sudo swapon --show

    If you receive no output, it means your system presently lacks swap space.

    You can also confirm the absence of active swap using the free utility:

    free -h

    As evident in the output, there is no active swap on the system, as shown in the Swap row.

    total used free shared buff/cache available Mem: 981Mi 122Mi 647Mi 0.0Ki 211Mi 714Mi SWAP: 0B 0B 0B Assessing Available Space on the Hard Drive Partition

    Before creating a swap file, it’s essential to check the current disk usage to ensure you have enough available space. This can be done by entering

    df -h Filesystem Size Used Avail Use% Mounted on tmpfs 1.6G 876K 1.6G 1% /run /dev/sda1 150G 65G 80G 45% / tmpfs 7.7G 0 7.7G 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock /dev/sda15 253M 6.1M 246M 3% /boot/efi tmpfs 1.6G 0 1.6G 0% /run/user/1009

    The device with / in the Mounted on column is our disk in this case. We have sufficient remaining space available - 65G used. Your availability will obviously be different.

    The appropriate size of a swap space can vary according to personal preferences and application requirements. Typically, an amount equivalent to or double the system’s RAM is a good starting point. For a simple RAM fallback, anything over 4G of swap is usually deemed unnecessary.

    Creating a Swap File

    Now that you’ve determined the available hard drive space, you can generate a swap file on your file system. A file of your desired size, named ‘swapfile,’ will be allocated in your root directory (/).

    The recommended method for creating a swap file is by using the fallocate program, which instantly generates a file of the specified size. For instance, if your server has 1G of RAM, you can create a 1G file as follows:

    sudo fallocate -l 1G /swapfile

    You can confirm the correct space allocation by running:

    ls -lh /swapfile

    The file will be created with the appropriate space allocation.

    Activating the Swap File

    Now that you have a correctly sized file, it’s time to turn it into swap space. Initially, you must restrict file access to only root users, enhancing security. To achieve this, execute:

    sudo chmod 600 /swapfile

    You can verify the permission change with:

    ls -lh /swapfile

    As seen in the output, only the root user has read and write permissions.

    Next, mark the file as swap space with:

    sudo mkswap /swapfile

    Afterward, enable the swap file to allow your system to utilize it:

    sudo swapon /swapfile

    You can verify the availability of swap by executing:

    sudo swapon --show

    Finally, recheck the output of the free utility to confirm the setup:

    free -h Making the Swap File Permanent

    The changes made enable the swap file for the current session, but they won’t persist through a system reboot. To ensure your swap settings remain, you can add the swap file information to your /etc/fstab file. Here’s how you can do it:

    Back up the /etc/fstab file as a precaution:

    sudo cp /etc/fstab /etc/fstab.bak

    Add the swap file information to the end of your /etc/fstab file with:

    echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab Adjusting Swap Settings

    There are several settings you can configure to influence your system’s performance with swap. Two key settings are the swappiness property and the cache pressure setting:

    Swappiness Property: This parameter determines how often data is swapped from RAM to the swap space. A value between 0 and 100 represents a percentage. Lower values (close to 0) mean less frequent swapping, while higher values (closer to 100) encourage more swapping. You can check the current swappiness value with:

    cat /proc/sys/vm/swappiness

    You can set a different value using the sysctl command. For example, to set the swappiness to 10:

    sudo sysctl vm.swappiness=10

    This setting persists until the next reboot, but you can make it permanent by adding it to your /etc/sysctl.conf file.

    Cache Pressure Setting: This setting affects how the system caches inode and dentry information over other data. Lower values, like 50, make the system cache this information more conservatively. You can check the current cache pressure value with:

    cat /proc/sys/vm/vfs_cache_pressure

    To set a different value, use the sysctl command and update your /etc/sysctl.conf file as you did with the swappiness setting.

  • Get help with network issues

    4 Topics
    273 Posts

    @phenomlab Found it - https://www.netspotapp.com/wifi-troubleshooting/best-wifi-booster-apps.html 👍

  • 4 Votes
    8 Posts
    322 Views

    @Panda said in Upgrade to NodeBB v3? 2BB or not 2BB, that is the question!:

    So although thats a plugin it has Widget like element and stopped working on the Theme change

    Which is normal based on the widgets being reset when you change themes.

  • Email set up on OVH Cloud

    Solved
    21
    1 Votes
    21 Posts
    733 Views

    @mventures that’s not an issue provided there is a password to go with the username

  • Smart Widgets

    Solved
    9
    3 Votes
    9 Posts
    312 Views

    @Panda said in Smart Widgets:

    So why is that, or conversely why would the function to expose username ever be required, as it seems app.user is already an available global object?

    It is, yes, but not if you are using it outside of a widget. The function I wrote is also historical and comes from the 2.x train 🙂

  • Further Widgets question

    Solved
    4
    1 Votes
    4 Posts
    148 Views

    @Panda category is for a category in its own, so for example, “fruit” whereas categories is the page that contains all categories as a list.

  • Side Bar

    Solved
    20
    1 Votes
    20 Posts
    285 Views

    yeap i see now

  • NodeBB v3 Quick reply

    Solved
    4
    2 Votes
    4 Posts
    170 Views

    here is the link: https://app.transifex.com/nodebb/nodebb/translate/#tr

  • NodeBB v3 Android Problem

    Solved
    4
    4 Votes
    4 Posts
    187 Views

    thank you fixed.

  • NodeBB: hCaptcha

    Solved
    15
    2 Votes
    15 Posts
    337 Views

    @mventures none that I know of. I don’t recall selecting these either for mine.

  • node vs nodejs confusion?

    Solved
    2
    1 Votes
    2 Posts
    140 Views

    @eeeee have a look at the below

    https://docs.nodebb.org/installing/os/ubuntu/

    curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash - sudo apt-get install -y nodejs

    You’ll notice that we are in fact “installing” NodeJS but never actually have a need to reference it. Here’s the nodejs --version command on my dev system

    6eb1482e-0c9b-454d-aa84-199bcc845702-image.png

    More detail here

    https://askubuntu.com/questions/1030622/why-do-i-see-different-versions-of-node-and-nodejs

  • NodeBB: Consent page

    Solved
    16
    4 Votes
    16 Posts
    557 Views

    @DownPW I still do not see any issues.

  • NodeBB: updating Admin details not working

    Solved
    17
    3 Votes
    17 Posts
    449 Views

    @mventures Ok. No issues

  • NodeBB: Opening the Composer for replies

    Solved
    2
    0 Votes
    2 Posts
    121 Views

    @mventures Quick reply is basically exactly that. However, it’s possible to trigger the full composer as below

    82ca1209-31be-4a51-a641-9887b5a238b8-image.png

    Failing that, you’ll need to use the reply button in the sticky toolbar

    1d230bcb-ff8e-4756-94f7-6e2fb7a94bc4-image.png

  • Upgrade Problem from 2.8.9 to 2.8.10

    Moved Solved
    15
    1 Votes
    15 Posts
    337 Views

    @cagatay Were any errors displayed during the upgrade process?

  • NodeBB: Favicon upload issue

    Solved
    12
    3 Votes
    12 Posts
    354 Views

    @phenomlab I am on a Mac, so I used the “Option + Command + I”, and then performed the steps. It loaded my favicon! I checked on Firefox which I haven’t used before, and it showed my favicon also! That’s fantastic and thank you for the help!

  • NodeBB: Creating pages

    Solved
    9
    0 Votes
    9 Posts
    274 Views

    OK, I think I have figured out how to place a link in the footer which will click to a new page.

  • NodeBB: The global Search option

    Solved
    5
    0 Votes
    5 Posts
    192 Views

    @mventures Yes, exactly. The other icon will restart NodeBB whilst the first icon I referenced will rebuild (recompile) it.

    The huge strength of NodeBB over Flarum (for example) is that the code is precompiled, and called once at boot. PHP’s code has to repeatedly reload code from source making it much slower.

  • 1 Votes
    6 Posts
    186 Views

    Up to you really 🙂

  • NodeBB: Upgrading to NodeBB v3.x

    Solved
    6
    0 Votes
    6 Posts
    221 Views

    @mventures You’d need to connect to the server and execute it directly - not on your local terminal. Review the guide below, which will show you how to gain access via SSH to your server

    https://docs.ovh.com/gb/en/dedicated/ssh-introduction/

    Once you have access, you’ll need to navigate to the actual folder where NodeBB is installed

    You’ll then need to change to the directory as shown below

    /home/unbuntu/nodebb

    fdffe673-bf63-4b6d-a728-5506fddc1aff-image.png

    In most cases, initial access takes you to the root of the file system. You can always issue pwd in a Linux terminal which will show you the Present Working Directory. From there, you can issue the command

    cd /home/ubuntu/nodebb

    Once in the NodeBB directory, you’d use the below commands

    ./nodebb stop git fetch && git checkout develop && git reset --hard origin/develop ./nodebb upgrade ./nodebb start

    Line 1 stops the NodeBB instance
    Line 2 gets the latest files from GIT (repository) and then checks out the development branch. It then resets the version you are using to the development branch ready for v3
    Line 3 Runs the upgrade once the new branch is set, and code pulled
    Line 4 Restarts the NodeBB instance after the upgrade has completed

    Note that when you restart NodeBB and log back in, things will look very different to what you had in v2.

  • NodeBB: Creating the Swatch modes

    Solved
    2
    0 Votes
    2 Posts
    130 Views

    @mventures the swatch feature you refer to isn’t a NodeBB plugin, but a utility that I wrote that handles this. It is available for v2 (as you can see here) but I’ve stopped developing and releasing the code because it has been entirely rewritten to work for v3.

    If you’d like the code, this is possible, but you’ll need to upgrade to v3 first.

  • Upgrade Problem from 2.8.3 to 2.8.4

    Solved
    35
    8 Votes
    35 Posts
    2k Views

    @cagatay No, you can ignore that.