Install NewLeaf first.
Change to the CloudTube user you created before:
# su cloudtube
Clone the repo:
$ git clone https://git.sr.ht/~cadence/cloudtube
$ cd cloudtube
Install dependencies:
$ npm install
Set up the configuration. Configuration is read from the filename config/config.js
. Copy the sample file to that name, then edit it.
You must set the setting for the default instance. You should write an address that is reachable from the machine running CloudTube. Hint: If CloudTube and NewLeaf are on the same machine, you can write http://localhost:3000
.
$ pushd config
$ cp config.sample.js config.js
$ $EDITOR config.js
$ popd
All done! Start CloudTube:
$ npm run start
In the future, from a new terminal session, CloudTube can be started with:
$ cd [installation directory]
$ npm run start
$ cd [installation directory]
$ git pull
$ npm install
Then start:
npm run start
If you want to control the services with systemd, you can use these files. This is optional.
This service should be run as the cloudtube user rather than as the system.
You may need to adjust the paths in these files.
If you find that these processes terminate when you log out, see the documentation for libpam-systemd
and logind.conf
.
[Unit]
Description=CloudTube website
[Service]
Type=simple
ExecStart=/usr/local/bin/node /home/cloudtube/cloudtube/server.js
WorkingDirectory=/home/cloudtube/cloudtube
# Restart timing
Restart=always
RestartSec=60
SyslogIdentifier=cloudtube
[Install]
WantedBy=default.target
Save to ~/.config/systemd/user/cloudtube.service
.
$ systemctl --user daemon-reload
$ systemctl --user start cloudtube
...and if all is successful...
$ systemctl --user enable cloudtube
[Unit]
Description=CloudTube
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/node /home/cloudtube/cloudtube/server.js
WorkingDirectory=/home/cloudtube/cloudtube
# Restart timing
Restart=always
RestartSec=60
# Disable logs
StandardOutput=null
StandardError=null
SyslogIdentifier=cloudtube
# User to run service as
User=cloudtube
[Install]
WantedBy=multi-user.target
Save to /etc/systemd/system/cloudtube.service
.
# systemctl daemon-reload
# systemctl start cloudtube
...and if all is successful...
# systemctl enable cloudtube
This will allow people to access CloudTube over HTTPS and without having to enter a port into the browser's address bar.
It's highly recommended for public instances, but if this installation is for a test or for your personal use, you don't need to do it.
Follow the steps on the nginx documentation page →