Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add upload link and download link API #683

Merged
merged 10 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
go-version: "1.22"
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
Expand All @@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
go-version: "1.22"
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
Expand Down
5 changes: 5 additions & 0 deletions ci/serverctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from collections import namedtuple
from contextlib import contextmanager
from os.path import abspath, basename, dirname, exists, join
import shutil

import requests
from tenacity import TryAgain, retry, stop_after_attempt, wait_fixed
Expand All @@ -24,6 +25,7 @@
class ServerCtl(object):
def __init__(self, topdir, projectdir, datadir, fileserver, db='sqlite3', seaf_server_bin='seaf-server', ccnet_server_bin='ccnet-server'):
self.db = db
self.topdir = topdir
self.datadir = datadir
self.central_conf_dir = join(datadir, 'conf')
self.seafile_conf_dir = join(datadir, 'seafile-data')
Expand Down Expand Up @@ -53,6 +55,9 @@ def setup(self):
os.mkdir (self.central_conf_dir, 0o755)
os.mkdir (self.seafile_conf_dir, 0o755)
os.mkdir (self.ccnet_conf_dir, 0o755)
src = join(self.projectdir, 'tests/conf/seahub_settings.py')
dst = join(self.central_conf_dir, 'seahub_settings.py')
shutil.copyfile(src, dst)

self.init_ccnet()
self.init_seafile()
Expand Down
12 changes: 9 additions & 3 deletions common/seaf-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,25 +418,31 @@ load_seahub_private_key (SeafileSession *session, const char *conf_dir)
char line[256];
char *site_root = NULL;
while (fgets(line, sizeof(line), file)) {
GMatchInfo *match_info;
GMatchInfo *match_info = NULL;
if (g_regex_match (secret_key_regex, line, 0, &match_info)) {
char *sk = g_match_info_fetch (match_info, 1);
session->seahub_pk = sk;
}
g_match_info_free (match_info);
match_info = NULL;

if (g_regex_match (site_root_regex, line, 0, &match_info)) {
site_root = g_match_info_fetch (match_info, 1);
}
g_match_info_free (match_info);
}

if (session->seahub_pk) {
if (site_root) {
session->seahub_url = g_strdup_printf("http://127.0.0.1:8000%sapi/v2.1/internal/user-list/", site_root);
session->seahub_url = g_strdup_printf("http://127.0.0.1:8000%sapi/v2.1/internal", site_root);
} else {
session->seahub_url = g_strdup("http://127.0.0.1:8000/api/v2.1/internal/user-list/");
session->seahub_url = g_strdup("http://127.0.0.1:8000/api/v2.1/internal");
}
session->seahub_conn_pool = connection_pool_new ();
} else {
seaf_warning ("No seahub private key is configured.\n");
}
g_free (site_root);

out:
if (secret_key_regex)
Expand Down
Loading
Loading