👷‍♂️

Setting up Scriptables

When you download Scriptables, you should see a similar folder structure as per below:
├── Dockerfile
├── LICENSE
├── README.md
├── build
│   ├── build.sh
│   ├── deploy.sh
│   ├── docker-entrypoint-initdb.d
│   ├── mysql
│   ├── rundev.sh
│   ├── server_arm
│   ├── server_linux
│   └── systemd
├── console
├── controllers
├── docker-compose.yml
├── documentation
├── example.env
├── go.mod
├── go.sum
├── main.go
├── middleware
├── models
├── parsers
├── scriptables
├── sshclient
├── templates
└── utils
└── static
​
Rename the "example.env" at the project root to just ".env" and change the settings accordingly:
MYSQL_HOST=scriptables-db
MYSQL_PORT=3306
MYSQL_DATABASE=scriptables
MYSQL_USER=kevin
MYSQL_PASSWORD=xxx
MYSQL_ROOT_PASSWORD=xxx
SCRIPTABLE_URL=http://127.0.0.1:3001
ALLOWED_IPS=127.0.0.1
REDIS_DSN=scriptables-redis:6379
ENCRYPTION_KEY=xxx
SMTP_HOST=xxx
SMTP_USERNAME=xxx
SMTP_PASSWORD=xxx
SMTP_PORT=2525
ALLOW_REGISTER=true
SMTP_FROM_EMAIL=Scriptables <[email protected]>
TZ=Africa/Johannesburg
SCRIPTABLES_SERVER_DSN_HOST=0.0.0.0
SCRIPTABLES_SERVER_DSN_PORT=3001
VERBOSE_LOGS=no
​
​
​
The encryption key should be 16,24 or 32 characters long.
If you plan on using the push-to-deploy functionality, you will also need to set your SCRIPTABLE_URL correctly. You can run Scriptables as is on port 3001 or use Nginx in front and proxy pass requests to the relevant port.
ALLOW_REGISTER - please set it to "false" after setting up the first user. This setting by default will allow anyone to register - which is not what you want in production. To add users, you can do so inside the Scriptables admin dashboard.
By default, Scriptables runs on port 3001. You can change this by setting the following ENV's:
SCRIPTABLES_SERVER_DSN_HOST=0.0.0.0
SCRIPTABLES_SERVER_DSN_PORT=3001
You can control the log level by setting the following ENV to yes/no.
When set to "yes" - all warning and informational logs are printed to the console. Please be careful not to turn this on in production as it can print sensitive information. This setting should only be used to debug issues with builds.
VERBOSE_LOGS=no
Note: when changing ENV's - run the following to ensure your updates take effect (only needed if you change env's after the first run):
docker-compose down --remove-orphans
docker-compose up -d --build
Once your config is set - simply run the following in your terminal:
docker-compose up -d --build
You should now see the Scriptables login screen.
Goto: /users/register to set up your account.
Once logged in please click on "Ssh Keys" and add your keys. These need to be the same keys you use when setting up your server in your hosting provider's dashboard.
Scriptables support multiple keys - so you can set up as many keys as needed. If you don't have SSH keys, you can easily generate a key pair using the following command in your terminal:
ssh-keygen -b 2048 -t rsa
Take note of the path to your keys. You will need to copy & paste into the Scriptables Ssh keys UI and add the pub key to your hosting account.
Note: we also provide a deploy.sh script in the build folder to help you deploy Scriptables to a remote server.
This script does not configure or secure your server, it merely copies the Scriptables binary to the remote box and sets up a systemd service to run and manage Scriptables.