Page 1 of 1

Playground is broken

Posted: Friday 29th March 2024 10:23pm
by neildarlow
Hi,

I'll post this here rather than in the programming sub-forums. It appears the Playground is broken. Any attempt to execute code shows a container start failure message in the output window.

ATB,
Neil Darlow

Re: Playground is broken

Posted: Saturday 30th March 2024 1:26am
by BruceSteers
It links to the Playground from the main gambas website.
https://gambas.sourceforge.net/en/main.html#

The error is there.

I have reported it to the development team.

Re: Playground is broken

Posted: Saturday 30th March 2024 8:48am
by cogier
It's not the Development Team that needs to look at this, it's me. I will sort it as.soon as I can.

10:10am 30/03/2024
Now fixed

https://gambas.one/playground/

Re: Playground is broken

Posted: Saturday 30th March 2024 12:10pm
by BruceSteers
cogier wrote: Saturday 30th March 2024 8:48am It's not the Development Team that needs to look at this, it's me. I will sort it as.soon as I can.

10:10am 30/03/2024
Now fixed

https://gambas.one/playground/
Aaaah , so does the gambas website playground link to you than?

Re: Playground is broken

Posted: Saturday 30th March 2024 1:34pm
by cogier
The playground is in a Digital Ocean Droplet. This is basically a headless Ubuntu distro with Gambas installed via the ppa. So yes, they link to Gambas One. The main page does have a link to the Playground and the Farm. https://wordpress.gambas.one/

Re: Playground is broken

Posted: Sunday 31st March 2024 8:03pm
by neildarlow
Thank you for fixing this. It's very useful for trying little things.

ATB,
Neil Darlow

Re: Playground is broken

Posted: Saturday 13th April 2024 10:28pm
by BruceSteers
I think it's broken again.

Do the Run/Play buttons on the gambas wiki also use the same system as that's showing the same message...

"docker start" requires at least 1 argument.
See 'docker start --help'.

Usage: docker start [OPTIONS] CONTAINER [CONTAINER...]

Start one or more stopped containers

Re: Playground is broken

Posted: Saturday 13th April 2024 11:19pm
by BruceSteers
How complex is the playground code?

does it need a docker to be secure?

I made something similar http://138.68.116.47/cgi-bin/Scripter.gambas

It can use gbs3 or Eval and forbids use of Shell and Exec with only this much code..

' Gambas class file

Export

Public p As Process

Public Sub WebButton1_Click()

  Dim sName As String = File.SetExt(Temp(), "gbs")
  Dim sTxt As String = taCode.Text

  If InStr(sTxt, "Shell ", 0, gb.Like) Or If InStr(sTxt, "Exec ", 0, gb.Like) Then
    Message("Shell and Exec are not allowed.")
    Return
  Endif

  If WebComboBox1.Index = 0 Then
    File.Save(sName, taCode.Text)
    taResult.Text = ""
    p = Exec ["gbs3", sName] For Read As "PROC"
    While p.State = Process.Running
      Wait 0.1
      If Not Object.IsValid(p) Then Break
    Wend
    Kill sName

  Else
    Try taResult.Text = Eval(taCode.Text)
    If Error Then taResult.Text = "Error:\n" & Error.Text
  Endif

End

Public Sub PROC_Read()

  Dim sText As String
  sText = Read #p, -256
  taResult.Text &= sText

End


Re: Playground is broken

Posted: Sunday 14th April 2024 10:17am
by cogier
OK. I have fixed it again. I'm going to have to do something with it to stop it breaking all the time.