Compare commits
2 Commits
91ff9625ec
...
9a4a8155e2
Author | SHA1 | Date | |
---|---|---|---|
9a4a8155e2 | |||
96b3f76ea2 |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
portable_python
|
1
caldav/htpasswd
Normal file
1
caldav/htpasswd
Normal file
@@ -0,0 +1 @@
|
|||||||
|
username:password
|
26
caldav/readme.md
Normal file
26
caldav/readme.md
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
|
||||||
|
how to make python portable
|
||||||
|
|
||||||
|
https://chat.mistral.ai/chat/ab946d87-22e6-47d4-a99c-e8522c077347
|
||||||
|
|
||||||
|
```
|
||||||
|
wget https://www.python.org/ftp/python/3.13.7/Python-3.13.7.tgz
|
||||||
|
tar -xzf Python-3.13.7.tgz
|
||||||
|
rm Python-3.13.7.tgz
|
||||||
|
cd Python-3.13.7
|
||||||
|
./configure --enable-optimizations --with-ensurepip=install --prefix=$(pwd)/portable_python
|
||||||
|
make -j$(nproc)
|
||||||
|
make install
|
||||||
|
# now in portable_python install packages that are needed
|
||||||
|
./portable_python/bin/pip3 install bcrypt
|
||||||
|
./portable_python/bin/pip3 install radicale
|
||||||
|
cd ..
|
||||||
|
mv Python-3.13.7/portable_python portable_python
|
||||||
|
rm -rf Python-3.13.7
|
||||||
|
cd ..
|
||||||
|
tar -czvf caldav.tar.gz caldav/
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
tar -xzf caldav.tar.gz
|
34
caldav/server.py
Normal file
34
caldav/server.py
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
from radicale import Application, config
|
||||||
|
from wsgiref.simple_server import make_server
|
||||||
|
import os
|
||||||
|
|
||||||
|
def run_server():
|
||||||
|
# Load default configuration
|
||||||
|
configuration = config.load()
|
||||||
|
|
||||||
|
# Customize settings
|
||||||
|
configuration.update({
|
||||||
|
"server": {
|
||||||
|
"hosts": "0.0.0.0:5232", # Listen on all interfaces
|
||||||
|
},
|
||||||
|
|
||||||
|
"storage": {
|
||||||
|
"filesystem_folder": "./calendars", # Store calendars here
|
||||||
|
},
|
||||||
|
"auth": {
|
||||||
|
"type": "htpasswd",
|
||||||
|
"htpasswd_filename": "./htpasswd", # Path to htpasswd file
|
||||||
|
"htpasswd_encryption": "autodetect", # or "sha1", "md5" (bcrypt is most secure)
|
||||||
|
},
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
# Create and run the app
|
||||||
|
app = Application(configuration=configuration)
|
||||||
|
server = make_server("0.0.0.0", 5232, app)
|
||||||
|
print("✅ Secure CalDAV server running on http://0.0.0.0:5232")
|
||||||
|
print("🔐 Authentication required. Default user: admin / password")
|
||||||
|
server.serve_forever()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
run_server()
|
Reference in New Issue
Block a user