Skip to content

Commit

Permalink
Merge branch 'passhweb-release'
Browse files Browse the repository at this point in the history
  • Loading branch information
elg committed Jun 12, 2020
2 parents d97fe95 + 201bc9b commit 4d3b03f
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
4 changes: 2 additions & 2 deletions passhweb/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
DEBUG = conf.getboolean("Misc", "DEBUG", fallback=False)
# Allow a username to connect without the right password when LDAP enabled
LOGINNOPWD = conf.get("Misc", "LOGINNOPWD", fallback=False)
FIRSTLAUNCH = conf.get("Misc", "FIRSTLAUNCH",
fallback=os.path.exists("/home/passhport/passhport/passhweb/.neverlaunched"))
FIRSTLAUNCH = conf.getboolean("Misc", "FIRSTLAUNCH",
fallback=os.path.exists("/home/passhport/passhport/.firstlaunch"))
SECRET = conf.get("Misc", "SECRET")

""" Module configuration """
Expand Down
Empty file modified tools/passhport-install-apache2-frontend-debian.sh
100644 → 100755
Empty file.
Empty file modified tools/passhport-install-postgresql-backend-debian.sh
100644 → 100755
Empty file.
23 changes: 23 additions & 0 deletions tools/passhweb-config-vm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

# First change secret in passhweb.ini
sed -i "s/^SECRET.*/SECRET = $(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 20 | head -n 1)/" /etc/passhport/passhweb.ini

# Commit on vm mode saying it's the first launch to activate config page
touch /home/passhport/passhport/.firstlaunch

#

systemctl restart apache2
9 changes: 8 additions & 1 deletion tools/vm-builder/packer/passhport-qemu-iso.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
"type": "file",
"source": "../../passhweb-install-script-debian.sh",
"destination": "/tmp/passhweb-install-script-debian.sh"
},
{
"type": "file",
"source": "../../passhweb-config-vm.sh",
"destination": "/tmp/passhweb-config-vm.sh"
},
{
"type": "shell",
Expand All @@ -76,7 +81,9 @@
"chmod +x /tmp/passhport-install-apache2-frontend-debian.sh",
"echo 'passhport' | sudo -S /tmp/passhport-install-apache2-frontend-debian.sh",
"chmod +x /tmp/passhweb-install-script-debian.sh",
"echo 'passhport' | sudo -S /tmp/passhweb-install-script-debian.sh"
"echo 'passhport' | sudo -S /tmp/passhweb-install-script-debian.sh",
"chmod +x /tmp/passhweb-config-vm.sh",
"echo 'passhport' | sudo -S /tmp/passhweb-config-vm.sh"
]
}
]
Expand Down

0 comments on commit 4d3b03f

Please sign in to comment.