• Allow and use a text.dat.local override file

    From Nigel Reed@1:103/705 to GitLab issue in main/sbbs on Saturday, September 23, 2023 11:50:35
    open https://gitlab.synchro.net/main/sbbs/-/issues/644

    The wiki suggests 4 methods to overwrite text.dat entries, all require the sysop to alter either text.dat or adding lines to existing files, therefore necessitating the creation of /sbbs/mods version. Once this is done, it's more difficult to maintain updates scripts.

    Allow the sysop to create /sbbs/ctrl/text.dat.local or /sbbs/mods/text.dat.local that only includes overwrites for existing entries. This file can then be read when require("text.js"... is used and would require the user to do nothing more than add text to text.dat.local.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Saturday, September 23, 2023 14:41:57
    https://gitlab.synchro.net/main/sbbs/-/issues/644#note_4241

    What does "only includes overwrites for existing entries" mean? It would include 860 blank lines and 5-non-blank lines (for 5 text.dat overrides)? That'd be pretty hard for a sysop to use.

    I'm not really clear what this proposed `text.dat.local` file would look like in practice.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Saturday, September 23, 2023 15:13:27
    https://gitlab.synchro.net/main/sbbs/-/issues/644#note_4242

    [replacetext.js](/uploads/f1d124ed68396c9c31a56b0bf368d563/replacetext.js)

    I wrote this script back in 2019 that reads ctrl/text.ini and can replace only the text.dat strings specified within:

    e.g. text.ini:
    ```
    None: "No way Jose!"
    ```

    But I didn't commit it because I did not find it to be demonstrably easier or better than:

    ```
    load('text.js');
    bbs.replace_text(None, "No way Jose!");
    ```
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Saturday, September 23, 2023 23:37:34
    https://gitlab.synchro.net/main/sbbs/-/issues/644#note_4243

    [replace_text.js](/uploads/1cb45a4ba01754128aa9b1cc0e9ca93a/replace_text.js)

    Here's an updated version that'll read from either .ini or .json.

    The advantage for JSON is UTF-8 encoding (maybe) and splitting strings across multiple lines. Otherwise, .ini is superior I think.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Nigel Reed@1:103/705 to GitLab note in main/sbbs on Saturday, September 23, 2023 23:48:11
    https://gitlab.synchro.net/main/sbbs/-/issues/644#note_4244

    The idea is that if I want to replace, let's say I want to overwrite

    ~~~
    "\1_\1b\1h[\1c@CHECKMARK@\1b] \1yEnter your full name or alias\1\\: \1w" 338 EnterYourAlias
    ~~~

    I could just put this into my text.dat.local file

    ~~~
    "\1_\1b\1h[\1c@CHECKMARK@\1b] \1yHow do you wish to be known?\1\\: \1w" 338 EnterYourAlias
    ~~~

    Then when using load('text.js'); it will first read in text.dat and then overwrite anything from text.dat.local automatically.

    That means, I don't have to go and put in replace_text anywhere.

    Another example, if replacing the text strings in user_settings.js then I could just put them in text.dat.local then I wouldn't have to copy the program into mods to do replace_text lines. The program would never receive updates.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Sunday, September 24, 2023 00:11:50
    https://gitlab.synchro.net/main/sbbs/-/issues/644#note_4245

    So the only line in the file could be that single line you're proposing?
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Sunday, September 24, 2023 00:40:41
    https://gitlab.synchro.net/main/sbbs/-/issues/644#note_4246

    So, I think my proposed .ini syntax is a little better:
    ```
    EnterYourAlias: "\1_\1b\1h[\1c@CHECKMARK@\1b] \1yHow do you wish to be known?\1\\: \1w"
    ```
    ... for a few reasons, but anyway, it wouldn't be a text.dat file, so best not to pretend that it is.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Tracker1@1:103/705 to Nigel Reed on Sunday, October 01, 2023 17:14:29
    Re: Allow and use a text.dat.local override file
    By: Nigel Reed to GitLab issue in main/sbbs on Sat Sep 23 2023 11:50:35

    entries. This file can then be read when require("text.js"... is used and would require the user to do nothing more than add text to text.dat.local.

    Or you can simply have a mods/mytext.js that overrides those fields you want to change... this is what I do on my board. I load it at the top of login.js, logon.js, etc. load("mytext.js");

    For example...

    bbs.replace_text(
    SystemPassword,
    "\r\1n\033[22;30f\1n\1cSYS_PASS\1h\1w: \1n\1h\1k(hidden)\1n "
    );
    bbs.replace_text(InvalidLogon, "\1n\033[24;79f");

    I am doing the above in my login.js explicitly in order to position the prompts where I want them in the display ansi. But you can just as easily have a bunch of bbs.replace_text for those you want to change in a mytext.js and load that in login and logon.


    --
    Michael J. Ryan
    +o roughneckbbs.com
    tracker1@roughneckbbs.com

    ---
    þ Synchronet þ Roughneck BBS - roughneckbbs.com
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Gamgee@1:103/705 to Tracker1 on Sunday, October 01, 2023 20:11:00
    Tracker1 wrote to Nigel Reed <=-

    Re: Allow and use a text.dat.local override file
    By: Nigel Reed to GitLab issue in main/sbbs on Sat Sep 23 2023
    11:50:35

    entries. This file can then be read when require("text.js"... is used and would require the user to do nothing more than add text to text.dat.local.

    Or you can simply have a mods/mytext.js that overrides those
    fields you want to change... this is what I do on my board. I
    load it at the top of login.js, logon.js, etc.
    load("mytext.js");

    For example...

    bbs.replace_text(
    SystemPassword,
    "\r\1n\033[22;30f\1n\1cSYS_PASS\1h\1w: \1n\1h\1k(hidden)\1n "
    );
    bbs.replace_text(InvalidLogon, "\1n\033[24;79f");

    I am doing the above in my login.js explicitly in order to
    position the prompts where I want them in the display ansi. But
    you can just as easily have a bunch of bbs.replace_text for those
    you want to change in a mytext.js and load that in login and
    logon.

    Or, even easier, you just embed the prompt postioning codes in the ANSI display file. That's what I do, works great and much simpler.



    ... He does the work of 3 Men...Moe, Larry & Curly
    --- MultiMail/Linux v0.52
    þ Synchronet þ Palantir BBS * palantirbbs.ddns.net * Pensacola, FL
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From nelgin@1:103/705 to Tracker1 on Monday, October 02, 2023 10:38:26
    Re: Allow and use a text.dat.local override file
    By: Tracker1 to Nigel Reed on Sun Oct 01 2023 17:14:29

    to change... this is what I do on my board. I load it at the top of login.js, logon.js, etc. load("mytext.js");

    Again, if you do this then it requires the sysop to put a copy in /sbbs/mods, which means they will not get any updates for these scripts. I do believe I mentioned that already.
    ---
    þ Synchronet þ End Of The Line BBS - endofthelinebbs.com
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Tracker1@1:103/705 to Gamgee on Wednesday, October 04, 2023 09:37:44
    Re: Re: Allow and use a text.dat.local override file
    By: Gamgee to Tracker1 on Sun Oct 01 2023 20:11:00

    I am doing the above in my login.js explicitly in order to
    position the prompts where I want them in the display ansi. But
    you can just as easily have a bunch of bbs.replace_text for those
    you want to change in a mytext.js and load that in login and
    logon.

    Or, even easier, you just embed the prompt postioning codes in the ANSI display file. That's what I do, works great and much simpler.

    So you find it easier to have your Username, password, etc prompts set to display separate ansi files?


    --
    Michael J. Ryan
    +o roughneckbbs.com
    tracker1@roughneckbbs.com

    ---
    þ Synchronet þ Roughneck BBS - roughneckbbs.com
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Tracker1@1:103/705 to nelgin on Wednesday, October 04, 2023 09:38:58
    Re: Allow and use a text.dat.local override file
    By: nelgin to Tracker1 on Mon Oct 02 2023 10:38:26

    to change... this is what I do on my board. I load it at the top of
    login.js, logon.js, etc. load("mytext.js");

    Again, if you do this then it requires the sysop to put a copy in /sbbs/mods, which means they will not get any updates for these scripts. I do believe I mentioned that already.

    If you have a text.local.dat file, or whatever, it's the same thing... you update text.dat and your local will override it anyway. You can update text.dat and if new strings, or ones you aren't overriding change, you get the update.


    --
    Michael J. Ryan
    +o roughneckbbs.com
    tracker1@roughneckbbs.com

    ---
    þ Synchronet þ Roughneck BBS - roughneckbbs.com
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Gamgee@1:103/705 to Tracker1 on Wednesday, October 04, 2023 07:36:00
    Tracker1 wrote to Gamgee <=-

    I am doing the above in my login.js explicitly in order to
    position the prompts where I want them in the display ansi. But
    you can just as easily have a bunch of bbs.replace_text for those
    you want to change in a mytext.js and load that in login and
    logon.

    Or, even easier, you just embed the prompt postioning codes in the ANSI display file. That's what I do, works great and much simpler.

    So you find it easier to have your Username, password, etc
    prompts set to display separate ansi files?

    No, that isn't what I said. Since you find it necessary to deliberately twist/confuse things (as usual), I'll not discuss it further with you.



    ... Ignorance can be cured. Stupid is forever.
    --- MultiMail/Linux v0.52
    þ Synchronet þ Palantir BBS * palantirbbs.ddns.net * Pensacola, FL
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From nelgin@1:103/705 to Tracker1 on Wednesday, October 04, 2023 10:13:47
    Re: Allow and use a text.dat.local override file
    By: Tracker1 to nelgin on Wed Oct 04 2023 09:38:58

    If you have a text.local.dat file, or whatever, it's the same thing... you update text.dat and your local will override it anyway. You can update text.dat and if new strings, or ones you aren't overriding change, you get the update.

    I can only explain the same thing so many times so I give up. Digital Man implemented what I needed so there is no need to have a copy of login.js or logon.js in the mods directory any more just to change text.
    ---
    þ Synchronet þ End Of The Line BBS - endofthelinebbs.com
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Ragnarok@1:103/705 to Tracker1 on Thursday, October 05, 2023 17:17:49
    El 4/10/23 a las 06:38, Tracker1 escribió:
    Re: Allow and use a text.dat.local override file
    By: nelgin to Tracker1 on Mon Oct 02 2023 10:38:26

    >> to change... this is what I do on my board. I load it at the top of
    >> login.js, logon.js, etc. load("mytext.js");

    ne> Again, if you do this then it requires the sysop to put a copy in
    ne> /sbbs/mods, which means they will not get any updates for these scripts. I
    ne> do believe I mentioned that already.

    If you have a text.local.dat file, or whatever, it's the same thing... you update text.dat and your local will override it anyway. You can update text.dat and if new strings, or ones you aren't overriding change, you get the update.

    why no merge?

    ctrl/text.dat has the "stock" lines

    line1 bla
    line2 ble
    line3 bli

    /etc/text.dat.d/my_first_override.dat (have the override lines)

    line2 blo

    result for sbbs

    line1 bla
    line2 blo
    line3 bli

    just a la debian that include and override stick options /etc/text.dat.d/*
    ---
    ï¿­ Synchronet ï¿­ Dock Sud BBS TLD 24 HS - bbs.docksud.com.ar
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab issue in main/sbbs on Thursday, October 26, 2023 14:34:04
    close https://gitlab.synchro.net/main/sbbs/-/issues/644
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Thursday, October 26, 2023 14:34:04
    https://gitlab.synchro.net/main/sbbs/-/issues/644#note_4389

    This was done.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)