compose-website/user_data

107 lines
3 KiB
Text
Raw Normal View History

2016-11-26 16:31:06 +00:00
#cloud-config
ssh_authorized_keys:
- "PUT YOUR SSH KEY PUBLIC HERE"
2016-11-26 16:31:06 +00:00
write_files:
2017-04-11 14:09:30 +00:00
- path: /etc/ssh/sshd_config
permissions: 0600
owner: root:root
content: |
# Use most defaults for sshd configuration.
UsePrivilegeSeparation sandbox
Subsystem sftp internal-sftp
PermitRootLogin no
AllowUsers core
PasswordAuthentication no
ChallengeResponseAuthentication no
2016-11-26 17:49:21 +00:00
- path: /etc/sysctl.d/libresh.conf
2016-11-26 16:31:06 +00:00
permissions: 0644
owner: root
2016-11-26 17:49:21 +00:00
content: |
fs.aio-max-nr=1048576
vm.max_map_count=262144
vm.overcommit_memory=1
vm.nr_hugepages=0
2016-11-26 16:31:06 +00:00
- path: /etc/hosts
permissions: 0644
owner: root
content: |
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
- path: /etc/environment
permissions: 0644
2016-11-26 16:31:06 +00:00
owner: root
content: |
NAMECHEAP_URL="namecheap.com"
NAMECHEAP_API_USER="pierreo"
NAMECHEAP_API_KEY=
IP=`curl -s http://icanhazip.com/`
FirstName="Pierre"
LastName="Ozoux"
Address=""
PostalCode=""
Country="Portugal"
Phone="+351.967184553"
EmailAddress="pierre@ozoux.net"
City="Lisbon"
CountryCode="PT"
BACKUP_DESTINATION=root@xxxxx:port
MAIL_USER=
MAIL_PASS=
MAIL_HOST=mail.indie.host
MAIL_PORT=587
coreos:
update:
reboot-strategy: off
units:
- name: systemd-sysctl.service
command: restart
- name: swap.service
enable: true
command: start
content: |
[Unit]
Description=Turn on swap
[Service]
Type=oneshot
RemainAfterExit=true
ExecStartPre=-/bin/bash -euxc ' \
fallocate -l 8192m /swap &&\
chmod 600 /swap &&\
mkswap /swap'
ExecStart=/sbin/swapon /swap
ExecStop=/sbin/swapoff /swap
[Install]
WantedBy=local.target
- name: install-compose.service
command: start
content: |
[Unit]
Description=Install Docker Compose
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=-/bin/bash -euxc ' \
mkdir -p /opt/bin &&\
url=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r \'.assets[].browser_download_url | select(contains("Linux") and contains("x86_64"))\') &&\
curl -L $url > /opt/bin/docker-compose &&\
chmod +x /opt/bin/docker-compose'
2016-12-23 07:38:20 +00:00
- name: install-libresh.service
2016-11-26 16:31:06 +00:00
command: start
content: |
[Unit]
2016-12-23 07:38:20 +00:00
Description=Install libre.sh
2016-11-26 16:31:06 +00:00
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=-/bin/bash -euxc ' \
git clone https://github.com/indiehosters/libre.sh.git /libre.sh &&\
mkdir /{data,system} &&\
mkdir /data/trash &&\
cp /libre.sh/unit-files/* /etc/systemd/system && systemctl daemon-reload &&\
2016-12-23 07:38:20 +00:00
systemctl enable web-net.service &&\
systemctl start web-net.service &&\
2016-11-26 16:31:06 +00:00
cp /libre.sh/utils/* /opt/bin/'