-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/origin/main'
- Loading branch information
Showing
14 changed files
with
297 additions
and
91 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
collections: | ||
- community.docker |
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 +1,3 @@ | ||
rclone_directory: "/opt/rclone" | ||
rclone_directory: "/opt/rclone" | ||
|
||
surf_research_vault_documentation: "https://servicedesk.surf.nl/wiki/x/yplsB" |
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
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
echo "<h1>Research Vault</h1>"; | ||
|
||
echo "<a href=\"{{ surf_research_vault_documentation }}\">Research Vault documentation</a><br/>"; | ||
|
||
echo "<h2>Research Vault server addresses</h2>"; | ||
|
||
$message = "No addresses configured yet. Administrator needs to do that first."; | ||
|
||
echo "<ul>"; | ||
foreach (glob("/etc/mounts/*.conf") as $filename) { | ||
$path = basename($filename, ".conf"); | ||
|
||
if ($path != "admin") { | ||
$message = ""; | ||
|
||
$path = "webdav/" . $path; | ||
|
||
echo "<li>'<a href=\"" . $_SERVER['url'] . "/" . $path . "\">" . $path . "'</a></li>"; | ||
} | ||
} | ||
echo "</ul>"; | ||
|
||
if ($message != "") { | ||
echo $message; | ||
} else { | ||
echo "<h2>Authentication</h2>"; | ||
echo "Authenticate with your SRAM User ID and your SRAM Token that you have registered for this SRAM Service"; | ||
} | ||
|
||
echo "<h2>Administration</h2>"; | ||
|
||
echo "You need to be member of the <b>{{ ADMIN_GROUP }}</b>"; | ||
|
||
echo "<ul>"; | ||
foreach (glob("/etc/mounts/*.conf") as $filename) { | ||
$path = basename($filename, ".conf"); | ||
if ($path == "admin") { | ||
$description = "Administration page"; | ||
echo "<li>rClone GUI <a href=\"" . $_SERVER['url'] . "/" . $path . "\">" . $description . "</a></li>"; | ||
echo "<li>rClone API <a href=\"" . $_SERVER['url'] . "/" . $path . "/api/doc\">" . $description . " (API Documentation)</a></li>"; | ||
} | ||
} | ||
echo "</ul>"; | ||
|
||
// phpinfo(); | ||
?> |
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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from Crypto.Cipher import AES | ||
from Crypto.Hash import SHA256 | ||
from Crypto import Random | ||
|
||
def encrypt(key, source, encode=True): | ||
key = SHA256.new(key).digest() # use SHA-256 over our key to get a proper-sized AES key | ||
IV = Random.new().read(AES.block_size) # generate IV | ||
encryptor = AES.new(key, AES.MODE_CBC, IV) | ||
padding = AES.block_size - len(source) % AES.block_size # calculate needed padding | ||
source += bytes([padding]) * padding # Python 2.x: source += chr(padding) * padding | ||
data = IV + encryptor.encrypt(source) # store the IV at the beginning and encrypt | ||
return base64.b64encode(data).decode() if encode else data | ||
|
||
def decrypt(key, source, decode=True): | ||
if decode: | ||
source = base64.b64decode(source.encode()) | ||
key = SHA256.new(key).digest() # use SHA-256 over our key to get a proper-sized AES key | ||
IV = source[:AES.block_size] # extract the IV from the beginning | ||
decryptor = AES.new(key, AES.MODE_CBC, IV) | ||
data = decryptor.decrypt(source[AES.block_size:]) # decrypt | ||
padding = data[-1] # pick the padding value from the end; Python 2.x: ord(data[-1]) | ||
if data[-padding:] != bytes([padding]) * padding: # Python 2.x: chr(padding) * padding | ||
raise ValueError("Invalid padding...") | ||
return data[:-padding] # remove the padding | ||
import base64 |
Oops, something went wrong.