Skip to content

Commit

Permalink
Merge branch 'v15.0-lxc-working' - updates for LXC/Proxmox build
Browse files Browse the repository at this point in the history
  • Loading branch information
JedMeister committed May 22, 2018
2 parents 47b9ae8 + d475afb commit 34136c3
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 18 deletions.
13 changes: 13 additions & 0 deletions debian/inithooks-lxc.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=inithooks-lxc: firstboot and everyboot initialization scripts (lxc)
After=console-getty.service
ConditionKernelCommandLine=!noinithooks
ConditionVirtualization=lxc

[Service]
Type=oneshot
EnvironmentFile=/etc/default/inithooks
ExecStart=/bin/sh -c '${INITHOOKS_PATH}/run'

[Install]
WantedBy=basic.target
1 change: 1 addition & 0 deletions debian/inithooks.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Description=inithooks: firstboot and everyboot initialization scripts
After=getty@tty8.service
ConditionKernelCommandLine=!noinithooks
ConditionVirtualization=!lxc

[Service]
Type=oneshot
Expand Down
6 changes: 5 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
dh $@ --with=systemd,python2

override_dh_installinit:
dh_installinit -r --no-start -- start 15 2 .
dh_installinit --name=inithooks -r --no-start -- start 15 2 .
dh_installinit --name=inithooks-lxc -r --no-start -- start 15 2 .

override_dh_systemd_enable:
dh_systemd_enable debian/*.service
2 changes: 1 addition & 1 deletion firstboot.d/10regen-sshkeys
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
echo "* Regenerating SSH cryptographic keys"

rm -f /etc/ssh/*_key{,.pub}
dpkg-reconfigure openssh-server
dpkg-reconfigure --frontend=noninteractive --no-reload openssh-server
4 changes: 2 additions & 2 deletions firstboot.d/30turnkey-init-fence
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ USERNAME=root
PROFILE_FIRSTLOGIN=$(eval printf ~$USERNAME)/.profile.d/turnkey-init-fence
[ -f $PROFILE_FIRSTLOGIN ] && chmod +x $PROFILE_FIRSTLOGIN

update-rc.d turnkey-init-fence defaults
/etc/init.d/turnkey-init-fence start
systemctl enable turnkey-init-fence
systemctl start turnkey-init-fence
echo 'turnkey-init-fence is up'
6 changes: 3 additions & 3 deletions firstboot.d/97turnkey-init-fence-disable
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

[ -z "$_TURNKEY_INIT" ] && exit 0; # ONLY run from within turnkey-init

if [ -x /etc/init.d/turnkey-init-fence ]; then
if systemctl is-active --quiet turnkey-init-fence; then

update-rc.d turnkey-init-fence remove;
/etc/init.d/turnkey-init-fence stop;
systemctl disable turnkey-init-fence
systemctl stop turnkey-init-fence

fi

Expand Down
31 changes: 20 additions & 11 deletions turnkey-init-fence/htdocs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<h1>Please initialize this system...</h1>

<p>Welcome to TurnKey! You need to initialize this system first before
you can use it. To do that you'll need to log into the root account.
you can use it. To do that you'll need to log into the root account via SSH.
The <i>turnkey-init</i> initialization program will start
automatically:</p>

Expand All @@ -20,12 +20,21 @@ <h1>Please initialize this system...</h1>

<h2>Can I log in without SSH?</h2>

<p>Yes. Point your browser at this machine's <a href="https://__document.domain__:12320/">webshell</a> :</p>

<a href="https://__document.domain__:12320/"><img src="/webshell.png" /></a>
<p>No. Unfortunately not.</p>

<p>Expect a browser warning regarding unsafe HTTPS encryption. This is
unavoidable with the use of auto generated self-signed SSL certificates.</p>
<h2>How do I log in via SSH?</h2>

<p>If you are connecting from Linux or MacOS, please open your terminal app
and type the command:</p>

<pre id="p1">ssh example</pre>

<p>If you are connecting from Windows, you will need to install an SSH client, such as
<a href="https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html">PuTTY</a>.
Then connect to: <strong id="p2">IP ADDRESS OR FQDN</strong></p>

<p>Note: you will need to have set a root password, or configured SSH keys before
logging in</p>

<h2>For more information, visit our website!</h2>

Expand All @@ -38,9 +47,9 @@ <h2>For more information, visit our website!</h2>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(function() {
$('a').each(function() {
this.href = this.href.replace('__document.domain__', document.domain)
});
});
document.getElementById("p1").innerHTML = "ssh root@" + document.domain;
document.getElementById("p2").innerHTML = document.domain;
</script>

<script src="https://ajax.turnkeylinux.org/initfence/proxmox/15.0rc1-stretch-amd64/core.js" async></script>
<script src="https://ajax.turnkeylinux.org/initfence/proxmox/15.0rc1-stretch-amd64/core.direct" async></script>

0 comments on commit 34136c3

Please sign in to comment.