-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a2ba317
commit 168aae3
Showing
5 changed files
with
99 additions
and
1 deletion.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#!/usr/bin/env python | ||
|
||
from optparse import OptionParser | ||
import os, sys | ||
import shutil | ||
import tempfile | ||
import urllib2 | ||
import subprocess | ||
import re | ||
import stat | ||
|
||
default_path = os.path.expanduser("~/.config/chromium") | ||
|
||
def main(): | ||
p = OptionParser("Usage: %prog <action>") | ||
p.add_option('-c', '--create', action='store_const', const='create', dest='action', default='run') | ||
p.add_option('-r', '--run', action='store_const', const='run', dest='action') | ||
p.add_option('--profile', default=None, dest='path') | ||
p.add_option('-x', '--exec', default='google-chrome', help='browser executable') | ||
p.add_option('--dump', action='store_true', help='dump payload') | ||
p.add_option('--bootstrap', action='store_const', dest='action', const='bootstrap') | ||
opts, args = p.parse_args() | ||
assert len(args) == 0 | ||
opts.path = opts.path or default_path | ||
import getpass | ||
passwd = getpass.getpass("password:") | ||
if __file__.endswith('.in'): | ||
opts.action = 'bootstrap' | ||
else: | ||
self_decrypt(opts, passwd) | ||
globals()[opts.action](opts, passwd) | ||
|
||
PAYLOAD="""-----BEGIN PGP MESSAGE----- | ||
Version: GnuPG v1.4.11 (GNU/Linux) | ||
jA0EAwMCBgJPugih0/xgyerQTAUnyw0QA7nx9u37hvvFF/IiuskTENRRkbbNJ2i3 | ||
2yhpl0RUC813o53WBlmCr6qbS/SnZuJGeuLNceqnKZjFp+PLQJ700TGCVLoYAqT5 | ||
0JC633fcZH6o6tJhxiDpKqTapvuJeT9IfIunDuGZETzG9X1BC22nkHVp0JrU93Bs | ||
ImKrE5AuiZ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922 | ||
Pipg/5AQZ4Ra4hbgpGrATvMNLROO6wcirXwWn2MXXiRTuN2RnGvMFSpQI2tGY1Kz | ||
A98OriafrZ6ICQhu8FG4HmnnEirVh/J0ggmG3MXzl7w97M1oV4mIMJrEXpjlSVon | ||
kzLqq++tVCPYpJv1uHTDCrUnN4tKsMlqSmxOF51ZGkwYOj4sVFOahYkJgCwCj7Dl | ||
Eec9I2bAD8LfqEfZ19YMWzVsokaQi13rmJsL61/MbtKC09X8SPhCL+Fqbqc= | ||
=AGzG | ||
-----END PGP MESSAGE----- | ||
""" | ||
|
||
def gpg(args, passwd, contents): | ||
tmp = tempfile.NamedTemporaryFile(delete=False) | ||
with tmp.file as f: | ||
f.write(contents) | ||
try: | ||
gpg = subprocess.Popen(['gpg', '--no-use-agent', '--output=-', '--passphrase-fd=0'] + args + [tmp.name], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr = subprocess.PIPE) | ||
out, err = gpg.communicate(passwd) | ||
finally: | ||
os.remove(tmp.name) | ||
assert gpg.returncode == 0, err | ||
return out | ||
|
||
|
||
def self_decrypt(opts, passwd): | ||
out = gpg(['--no-use-agent', '--decrypt'], passwd, PAYLOAD) | ||
if opts.dump: | ||
print out | ||
sys.exit(0) | ||
else: | ||
out = re.sub('^#.*$', '', out) | ||
exec(out) | ||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
chrome-on-a-stick |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
|
||
set -ex | ||
[ "$#" -eq 1 ] | ||
[ "$1" -eq 0 -o "$1" -eq 1 ] | ||
echo "$1" > /selinux/enforce | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters