crazy-max / dokuwiki-plugin-syntaxhighlighter4

SyntaxHighlighter4 plugin for DokuWiki
http://bit.ly/2vfZ9jG
Other
53 stars 5 forks source link

Cannot add code to dokuwiki page #18

Closed Blommeke77 closed 6 years ago

Blommeke77 commented 6 years ago

Hello,

When I try to save some bash code to a dokuwiki page, I get an error on this specific line:

_spawn sed -i "/$host/d" /root/.ssh/knownhosts

Is there a way to bypass this?

Kind regards,

John

crazy-max commented 6 years ago

Hi @Blommeke77, i cannot reproduce your issue :

image

Can you post your wiki code?

Blommeke77 commented 6 years ago

Hi Crazy-Max,

Thanks for your quick response. Below the complete code. When I try to save or preview this page I get the following error You don't have permission to access /doku.php on this server. :

<sxh bash>
#!/usr/bin/expect

## SSH host login settings
set host "xxx.xxx.xxx.xxx"
set port "4118"
set user "username"
set pass "password"

## Encryption key between 8-15 characters
set encryptionkey "********"

## Script variables
set multiprompt "(%|#|>|\\$ )"
set prompt [string trim $multiprompt]
set timeout 30
set counter 0
set date [exec date +%F-%H-%M-%S]

## Check if host is alive and responds to PING
## -c number of pings to perform
## -i interval
## -W timeout
spawn ping -c 2 -i 3 -W 1 $host

expect {
    " 0%" {
    ## Host is alive
        ## Remove SSH host from known_hosts file
        spawn sed -i "/$host/d" /root/.ssh/known_hosts
        expect -re $prompt
        ## Login to SSH host and accept SSH fingerprint
        spawn ssh $user@$host -p $port
        expect "Are you sure you want to continue connecting (yes/no)?"
        send "yes\r"
        expect "Password:"
        send "$pass\r"
        expect -re $prompt

        ## Send commands to SSH host
        send "backup image ${encryptionkey} to usb BUP-${date}.fxi\r"
        expect {
            timeout {
               incr counter;
               if { $counter == 15 } {
                   puts "Backup took longer than 5 minutes.\r\r";
                   exit 1;
                }
                puts "Waiting for backup to complete...\r\r";
                exp_continue;
            }
            -re $prompt {
                puts "Backup is complete.\r\r";
            }
        }
        ## Delete existing auto-restore backup file
        send "no usb auto-restore\r"
        expect -re $prompt

        ## Convert backup file to auto-restore backup file
        send "usb auto-restore ${encryptionkey} BUP-${date}.fxi\r"
        expect {
            timeout {
               incr counter;
               if { $counter == 15 } {
                   puts "Creating auto-restore backup took longer than 5 minutes.\r\r";
                   exit 1;
                }
                puts "Waiting for creating auto-restore backup to complete...\r\r";
                exp_continue;
            }
            -re $prompt {
                puts "Creating auto-restore backup is complete.\r\r";
                }
            }
        }
    " 100%" {
    ## Host not alive
    puts "Cannot connect to host."
    }
}
## Exit SSH session
send "exit\r\r"
</sxh>
crazy-max commented 6 years ago

Unfortunately I still don't reproduce your problem :

sxh-bash

Can you try on a new DokuWiki installation? Did you also check if another plugin was in conflict?

Blommeke77 commented 6 years ago

Hi CrazyMax,

Thanks again. I installed Dokuwiki on another system and no wit works just fine with all the same plug-ins.

Must be something on my hosting VPS.

Keep up the good work! Love this plug-in. 😉

Kind regards,

John

Van: CrazyMax [mailto:notifications@github.com] Verzonden: maandag 14 mei 2018 13:01 Aan: crazy-max/dokuwiki-plugin-syntaxhighlighter4 dokuwiki-plugin-syntaxhighlighter4@noreply.github.com CC: Blommeke77 jcblom@gmail.com; Mention mention@noreply.github.com Onderwerp: Re: [crazy-max/dokuwiki-plugin-syntaxhighlighter4] Cannot add code to dokuwiki page (#18)

Unfortunately I still don't reproduce your problem :

https://user-images.githubusercontent.com/1951866/39993651-dc12695e-5776-11e8-8289-60f33c657131.png

Can you try on a new DokuWiki installation? Did you also check if another plugin was in conflict?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/crazy-max/dokuwiki-plugin-syntaxhighlighter4/issues/18#issuecomment-388778712 , or mute the thread https://github.com/notifications/unsubscribe-auth/AlcWIddSQVhz0BRG5uRUvXYKeFUY539yks5tyWP6gaJpZM4T9cHM . https://github.com/notifications/beacon/AlcWIZX3DiC8vAKu8mTJkJlSNEgOghJVks5tyWP6gaJpZM4T9cHM.gif

crazy-max commented 6 years ago

Thanks have a nice day ;)