forked from briorg/custom-kinoite
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
4 changed files
with
48 additions
and
172 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,63 +1,46 @@ | ||
#!/bin/sh | ||
# | ||
# ripped and hacked by bri from 1password's official after-install.sh | ||
# | ||
set -eu | ||
mkdir /tmp/1p | ||
pushd /tmp/1p | ||
curl -LO https://downloads.1password.com/linux/tar/stable/x86_64/1password-latest.tar.gz | ||
tar -xf 1password-latest.tar.gz | ||
cd 1password-*.x64 | ||
|
||
# Fill in policy kit file with bri # a list of (the first 10) human users of the system. | ||
export POLICY_OWNERS | ||
POLICY_OWNERS="unix-user:bri " | ||
#POLICY_OWNERS="$(cut -d: -f1,3 /etc/passwd | grep -E ':[0-9]{4}$' | cut -d: -f1 | head -n 10 | sed 's/^/unix-user:/' | tr '\n' ' ')" | ||
eval "cat <<EOF | ||
$(cat ./com.1password.1Password.policy.tpl) | ||
EOF" > ./com.1password.1Password.policy | ||
|
||
# Install policy kit file for system unlock | ||
install -Dm0644 ./com.1password.1Password.policy -t /usr/share/polkit-1/actions/ | ||
|
||
# Install examples | ||
install -Dm0644 ./resources/custom_allowed_browsers -t /usr/share/doc/1password/examples/ | ||
|
||
# chrome-sandbox requires the setuid bit to be specifically set. | ||
# See https://github.com/electron/electron/issues/17972 | ||
# chmod 4755 ./chrome-sandbox | ||
# | ||
# GROUP_NAME="onepassword" | ||
# | ||
# # Setup the Core App Integration helper binary with the correct permissions and group | ||
# if [ ! "$(getent group "${GROUP_NAME}")" ]; then | ||
# groupadd "${GROUP_NAME}" | ||
# fi | ||
# | ||
# HELPER_PATH="./1Password-KeyringHelper" | ||
# BROWSER_SUPPORT_PATH="./1Password-BrowserSupport" | ||
# | ||
# chgrp "${GROUP_NAME}" $HELPER_PATH | ||
# # The binary requires setuid so it may interact with the Kernel keyring facilities | ||
# chmod u+s $HELPER_PATH | ||
# chmod g+s $HELPER_PATH | ||
# | ||
# # This gives no extra permissions to the binary. It only hardens it against environmental tampering. | ||
# chgrp "${GROUP_NAME}" $BROWSER_SUPPORT_PATH | ||
# chmod g+s $BROWSER_SUPPORT_PATH | ||
# | ||
# # Restore previous directory | ||
# cd "$CWD" | ||
# | ||
# Register path symlink | ||
ln -sf /opt/1Password/1password /usr/bin/1password | ||
# | ||
#if [ "$(id -u)" -ne 0 ]; then | ||
# echo "You must be running as root to run 1Password's post-installation process" | ||
# exit | ||
#fi | ||
# | ||
#installFiles | ||
#installAutoupdateChannel | ||
# | ||
#exit 0 | ||
#!/usr/bin/env sh | ||
|
||
set -e | ||
|
||
echo "Installing 1Password" | ||
cd /usr/lib | ||
wget -qO- https://downloads.1password.com/linux/tar/stable/x86_64/1password-latest.tar.gz | tar -zxv | ||
ln -s 1Password 1password-* | ||
cd "$(mktemp -d)" | ||
|
||
mkdir /var/opt | ||
rpm-ostree install https://downloads.1password.com/linux/rpm/stable/x86_64/1password-latest.rpm | ||
|
||
# rpm -ivh ./1password-latest.rpm | ||
|
||
# This is where the mess starts. 1Password is installed to /opt/1Password with | ||
# No way to change it. RIP. So we kinda _hack_ it and hope nothing is hard set | ||
# in the compiled code :( | ||
mv /var/opt/1Password /usr/lib/1Password | ||
cat > /usr/bin/install-1password <<EOF | ||
#!/bin/bash | ||
ln -s /usr/lib/1Password /opt/1Password | ||
EOF | ||
chmod +x /usr/bin/install-1password | ||
|
||
# # Rewrite some hard set paths here | ||
# grep -rl "/opt/1Password" /usr/lib/1Password | xargs sed -i 's/\/opt\/1Password/\/usr\/lib\/1Password/g' | ||
# grep -rl "/opt/1Password" /usr/share/applications | xargs sed -i 's/\/opt\/1Password/\/usr\/lib\/1Password/g' | ||
# | ||
# # And redo the binary link | ||
# rm /usr/bin/1password | ||
# ln -s /usr/lib/1Password/1password /usr/bin/1password | ||
|
||
# Then we install the 1password CLI binary as well | ||
|
||
wget -q https://cache.agilebits.com/dist/1P/op2/pkg/v2.14.0/op_linux_amd64_v2.14.0.zip | ||
|
||
unzip op_linux_amd64_v2.14.0.zip | ||
|
||
mv op /usr/bin | ||
|
||
groupadd onepassword-cli | ||
chown root:onepassword-cli /usr/bin/op | ||
chmod g+s /usr/bin/op | ||
|
||
op --version |
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