Skip to content

Is config.sessionStartupCustom possible on Workbench? #344

@SamEdwardes

Description

@SamEdwardes

The Workbench Helm chart currently has a config.startupCustom key. For example:

startupCustom:
create-users-ongoing.sh: |
#!/bin/bash
for user in users.txt; do
USERNAME=$(cat users.txt | grep -v '^\s*#'| cut -d: -f1)
USERID=$(cat users.txt | grep -v '^\s*#'| cut -d: -f2)
echo "$USERNAME"
PASSWORD=$(cat users.txt | grep -v '^\s*#'| cut -d: -f3)
useradd -u $USERID -m -s /bin/bash -N $USERNAME
echo "$USERNAME:$PASSWORD" | sudo chpasswd
done;
echo 'sleeping forever'
while :; do read; done

Would it be possible to have scripts that run when a IDE session starts? The motivation for this is a want to create a symlink on the session container before the IDE starts. For example:

config:
  session:
    repos.conf:
      RSPM: https://packagemanager.rstudio.com/cran/__linux__/jammy/latest
      CRAN: https://packagemanager.rstudio.com/cran/__linux__/jammy/latest
  sessionStartupCustom:
    symlink-odbc.sh: |
      #!/bin/bash
      ln -s /mnt/session-secret/odbc.ini /ect/odbc.ini
  sessionSecret:
    odbc.ini: |
      [ProjectAbcDatabase]
      Database=project_abc
      Driver=PostgreSQL
      Password=password
      Port=5432
      Servername=database-postgresql
      UserName=posit_team

Or maybe there is a way to already do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions