Skip to content

Instantly share code, notes, and snippets.

@brandocorp
Created July 4, 2016 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandocorp/a98ddbb13cdeb8da534f9d0691c5d728 to your computer and use it in GitHub Desktop.
Save brandocorp/a98ddbb13cdeb8da534f9d0691c5d728 to your computer and use it in GitHub Desktop.
LXD Profiles
name: default
config:
user.user-data: |
#cloud-config
users:
- name: admin
groups: sudo
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
gecos: Local Admin
ssh-authorized-keys:
- ssh-rsa AAAAB3Nz ... 0GFzsw==
name: rtorrent
config:
raw.lxc: |
lxc.id_map = u 400000 1000 1
lxc.id_map = g 400000 1000 1
user.user-data: |
#cloud-config
users:
- name: rtorrent
primary-group: 400000
uid: 400000 # only works in xenial
groups: sudo
shell: /bin/bash
sudo: ['ALL=(ALL) NOPASSWD:ALL']
package_upgrade: true
packages:
- openssl
- git
- apache2
- apache2-utils
- libapache2-mod-scgi
- php
- php-curl
- php-cli
- libapache2-mod-php
- tmux
- unzip
- curl
- rtorrent
runcmds:
- "git clone https://github.com/Kerwood/Rtorrent-LXC.git"
- "cp Rtorrent-LXC/000-default.conf Rtorrent-LXC/000-default-auth.conf /etc/apache2/sites-available"
- "cp Rtorrent-LXC/plugins/ /var/www/html"
- 'sh -c "$(cd /var/www/html/plugins/theme/themes && curl -fsSL https://raw.githubusercontent.com/exetico/FlatUI/master/install.sh)"'
- "chown -R www-data:www-data /var/www/html"
- "chown rtorrent.rtorrent /home/rtorrent/.rtorrent.rc /home/rtorrent/.rtorrent-session /downloads /watch"
write_files:
- content: |
[Unit]
Description=rTorrent Daemon
After=network.target
[Service]
Type=forking
KillMode=none
User=rtorrent
ExecStart=/usr/bin/tmux new-session -s rtorrent -n rtorrent -d /usr/local/bin/rtorrent
ExecStop=/usr/bin/bash -c "/usr/bin/tmux send-keys -t rtorrent C-q && while pidof rtorrent > /dev/null; do sleep 0.5; done"
WorkingDirectory=/home/rtorrent
Restart=on-failure
[Install]
WantedBy=multi-user.target
path: /etc/systemd/system/rtorrent.service
description: allow home dir mounting for rtorrent
devices:
downloads:
path: /downloads
source: /home/brandocorp/downloads
type: disk
watch:
path: /watch
source: /home/brandocorp/watch
type: disk
eth0:
name: eth0
nictype: bridged
parent: lxdbr0
type: nic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment